How does the browser recognize angularjs tags in html?

We know that html is a client side script, when using the angularjs framework in html we include "ng" in the html tags. Question. How the browser recognizes or identifies html tags that have "ng" .please give the right solution for my question.

+4
source share
5 answers

Below the dot helped me understand: "How angularjs tags are recognized by the browser":

  • The AngularJS HTML compiler allows the developer to teach the new HTML browser 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 extension directives.

Read more about how the HTML compiler works: https://docs.angularjs.org/guide/compiler

+2
source

Angular 1 needs the angular.js file, which will be included in index.html so that it translates the directives into a browser-friendly form.

Whereas angular2 uses typesscript, in which a script type compiler compiles or translates typescript code into a clear javascript / ecmascript browser that will be displayed on the screen.

angular js " " , angular 2 javascript/ecmascript. , , javascript/ecmascript .

+1

angular/ng. 1 angular (angular.js script) .


1 Google .

0

Angular , , , angular.

angular angular DOM, ( ng-options, ng-if ..). DOM $compile. DOM , angular .

HTML, , .

0

ng-app angular. (ng-app="myApp") HTML, ng .

   angular.module('myApp', []);//module definition in JS File

   <body ng-app="myApp">
   <div ng-controller="myCntrl">
        <input type="text" ng-model="User"/> //this will be recognized and compiled 
    </div>

, , .

0

All Articles