Answers for "angularjs - controllerAs"

0

angularjs - controllerAs

angular.module('myApp', [])
.config(function ($stateProvider) {
  $stateProvider
  .state('main', {
    url: '/',
    controller: 'MainController as MC',
    templateUrl: '/path/to/template.html'
  })
}).
controller('MainController', function () { … });
Posted by: Guest on May-19-2021
0

angularjs - controllerAs

<div ng-controller="MainController as MC">
   …
</div>
Posted by: Guest on May-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language