Modules are containers for appication controller. They contain different parts of an application.
var app = angular.module("firstApp", []);
app.controller("firstCtroller", function($scope) { $scope.state = "Hyderabad"; $scope.city = "Sikandrabad"; });
[/html]
In above example $scope.
Adding Custom Directive:
You can add custom directive to your application. There are certain rules to define custom directives.
you nee do create module and then you can add directive to that module.
app.directive("customDirective", function() { return { template : "Hello directive..." }; });
[/html]
You can see here, app is an application object and app directive adds custom-directive to your application object.
notice if directive name is separated by hyphen(-), it would be camelCase while adding to:
[/html]
A Noun is the name of a person, place or thing. or Name of anything is noun. For example: Sita…
Misko Hevery, a Google employee, developed AngularJS. First version 1.0 of AngularJS was released in 2012. Now AngularJS is fully…
AngularJS expressions contain operators,literals, and variables. AngularJS expressions can be written inside HTML while JavaScript expressions can't be. AngularJS expressions…
Some sentences are given below. Choose the nouns and mention the type of noun whether they are proper noun, common…
Using Directives you can extend HTML attributes. In AngularJS you can define your own directives while it has its own…