Thursday, August 11, 2016

controller in Angular JS

<Script SRC="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
<script>  
  //Create module
  var app = angular.module("moduleName",[]);
 
  //Create the controller
  function myControl($scope) {
    $scope.yourProperty = 'This is Actioncontroller';
  }
 
  //Register controller with module
  app.controller("myControl",myControl);
</script>
</head>
<body>
<h1 ng-controller="myControl">Message -  {{  yourProperty  }}</h1> 

No comments:

Post a Comment