Modules – AngularJS
Modules are containers for appication controller. They contain different parts of an application. <div ng-app="firstApp" ng-controller="firstCtroller"> {{ state + " " + city }} </div> <script> var app = angular.module("firstApp", []); app.controller("firstCtroller", function($scope) { $scope.state = "Hyderabad"; $scope.city = "Sikandrabad"; }); </script> Try 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. <div ng-app="appOne" custom-directive></div><script> var app = angular.module("appOne", []); app.directive("customDirective", function() { return { template : "<span id='newspan' style='color:GREEN'>Hello […]
