Thursday, June 22, 2017

Using AngularJS on the localhost

AngularJS directives are extensions of HTML markups. They are one of several components of AngularJS. Directives can be attributes, element names, CSS class etc.

AngularJS script reference is important and the script can be found here:

https://ajax.googleapis.com/ajax/libs/angularjs/1.2.25/angular.min.js"
The above script reference needs to be added to your hTML page.

You can find the whole list of directives here:
https://docs.angularjs.org/api

Here is the usage of some directives placed in a html page that can be displayed on your localhost (in this case the IIS in Windows 10). Place this code with a suitable name in the inetpub / wwwroot directory.

======================


  Some directives in AngularJS

ng-app
Sorry, blogger still does not support the "pre" tag!
==============
When viewed on the browser (in this case Microsoft Edge), the HTML page renders as shown.


Do the following on this interactive page:
  • Type anything it gets copied next to Hello
  • Enter the increment region with your mouse, the count (presently 1) gets incremented
  • Click the link and you get to the page
Directives used in the page above and their description:
ng-app: initializes an AngularJS application
ng-model: binds the value of HTML controls (input, select, textarea) to application data
ng-init: initializes application data
ng-mouseenter: an AngularJS mouse event as a cursor moves over an dom element
ng-href: supported by the "a" tag and should be used when AngularJS code as in the example


No comments:

DMCA.com Protection Status