Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angularjs - controllerAs

angular.module('myApp', [])
.config(function ($stateProvider) {
  $stateProvider
  .state('main', {
    url: '/',
    controller: 'MainController as MC',
    templateUrl: '/path/to/template.html'
  })
}).
controller('MainController', function () { … });
Source by www.toptal.com #
 
PREVIOUS NEXT
Tagged: #angularjs #controllerAs
ADD COMMENT
Topic
Name
6+7 =