Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does the browser recognize angularjs tags in html?

We know that html is the client side scripting, while using angularjs framework in html we include "ng" in html tags.My Question is how the browser recognize or identifies the html tags which has "ng".please give the right solution for my question.

like image 574
rajaguru r Avatar asked Feb 20 '15 05:02

rajaguru r


People also ask

How does AngularJS work with HTML?

AngularJS extends HTML with ng-directives. The ng-app directive defines an AngularJS application. The ng-model directive binds the value of HTML controls (input, select, textarea) to application data. The ng-bind directive binds application data to the HTML view.

How does an Angular application run with in a HTML page?

How AngularJS Integrates with HTML. The ng-app directive indicates the start of AngularJS application. The ng-model directive creates a model variable named name, which can be used with the HTML page and within the div having ng-app directive.

What browsers does AngularJS work with?

What browsers does AngularJS work with? We run our extensive test suite against the following browsers: the latest versions of Chrome, Firefox, Safari, and Safari for iOS, as well as Internet Explorer versions 9-11. See Internet Explorer Compatibility for more details on supporting legacy IE browsers.

Is AngularJS completely based on HTML and?

Answer: A) ng-model is used to find the values of HTML controls to application data. 14. Choose whether true or false: Angular JS is completely based on HTML and JavaScript. Answer: A) The above statement is true.


2 Answers

Below point helped me in understanding "How angularjs tags are understood by the browser":

  • AngularJS's HTML compiler allows the developer to teach the browser new HTML syntax. The compiler allows you to attach behavior to any HTML element or attribute and even create new HTML elements or attributes with custom behavior. AngularJS calls these behavior extensions directives.

For detailed information on how HTML compiler works, please follow the below link: https://docs.angularjs.org/guide/compiler

like image 113
Durgaachandrakala.E Avatar answered Oct 20 '22 00:10

Durgaachandrakala.E


Angular 1 needs the angular.js file to be included in the index.html so that it will translate the directives to browser understandable form.

While in the angular2 the typesscript is used, in which the type script compiler compiles or translates the typescript code into the browser understandable javascript/ecmascript automatically which will be rendered on screen.

The angular js will run on the fly in the browser while angular 2 and above needs the precompilation or can be said as translation to javascript/ecmascript. Also if the translation is mentioned with a production build flag the translated javascript/ ecmascript will be a minified one.

like image 26
PranavKAndro Avatar answered Oct 19 '22 23:10

PranavKAndro