I am trying to transition a user from the landing page to a user page. It works fine with ui-sref. However, if I change it to ng-click="go('menu.home')", it stops working. When I click on the link, it does not do anything. Is there some kind of option/setting that I am missing?
The state
.state('menu', {
url: '/menu',
abstract: true,
views: {
"header@": {
templateUrl: '/Navigation/AuthenticateHeader',
controller: 'AuthenticateHeader'
// function ($scope) {
// $scope.message = 'Navigation Header.'
//}
},
"content@": {
templateUrl: '/Landing/Home',
controller: function ($scope) {
$scope.message = 'Home page';
}
},
'landingnav@menu': {
templateUrl: '/Landing/AuthHeader',
controller: function ($scope) {
$scope.message = 'Landing Header';
}
},
'landingcontent@menu': {
templateUrl: '/Landing/Index',
controller: function ($scope) {
$scope.message = 'Landing Header';
}
}
}
})
.state('menu.home',
{
url: '/home',
views: {
'landingnav@menu': {
templateUrl: '/Landing/AuthHeader',
controller: function ($scope) {
$scope.message = 'single message';
}
},
'landingcontent@menu': {
templateUrl: '/Landing/Index',
controller: function ($scope, UserOptionsFactory) {
var options = UserOptionsFactory.CheckOptions;
console.log(options);
if (options !== null) {
$scope.isAdministrator = options.isAdministrator;
}
}
}
}
})
The link with ui-sref and ng-click
<li ng-click="go('menu.home')">
<i class="fa fa-5x fa-User"></i>
<span>User</span>
</li>
<li>
<a ui-sref="menu.home">
<i class="fa fa-5x fa-User"></i>
<span>User</span>
</a>
</li>
go()look like?