I just starting with AngularJS and I have a routing issue with ui-router. Basically I have a partial that displays a button to sign in. The issue is that clicking on that button does not call the corresponding method in the controller.
The module definition:
var myapp = angular.module('myapp', ['ui.state']);
myapp.config(function($stateProvider, $routeProvider) {
$stateProvider.state('signin', {
url : "/", // root route
views : {
"signinView" : {
templateUrl : 'signin.html'
}
},
controller: function($scope) {
$scope.auth = function() {
console.log("clicked");
};
}
//controller: 'LoginController'
}).state('signedin', {
views : {
"signinView" : {
templateUrl : 'partials/signedin.html'
}
}
});
});
The signin.html:
<button class="btn" ng-click="auth()">Sign In</button>
Plunker thats shows the issue.