I have the following state setup for a page using an abstract state and the controller as syntax:
# Details page route
.state \'title\',
url: \'/title\',
ab
You will have to return this;
at the end of your controller function
for the controllerAs
syntax to work.
angular.module('title').controller 'Title',
['$state', ($state) ->
this.name = 'Test'
return this
If you are working with $scope
, you'll have to return $scope
instead.
angular.module('title').controller 'Title',
['$state','$scope', ($state, $scope) ->
$scope.name = 'Test'
return $scope
Good Luck.