var app = angular.module("myApp", ['ui.router']).
config(['$stateProvider', function ($stateProvider) {
$stateProvider.state('login', {
url: '/login',
templateUrl: '/templates/LoginPage.html',
controller: 'loginController'
});
}]);
app.controller("homePageController", function ($scope, $state) {
var self = this;
$scope.isLoginError = false;
$scope.loginSuccess = false;
$scope.validateCredentials = function () {
if ($scope.userName != '' && $scope.passWord != '') {
$scope.loginSuccess = true;
$scope.isLoginError = false;
// $location.url('/login');
$state.go('login');
}
else {
$scope.isLoginError = true;
}
}
});
// This is my angularJS code and when a state gets changed http://localhost:44212/templates/homePage.html#!/login I am getting ! in the URL and it's not navigating to other views.
Can anyone please help me out to solve this problem.
Thanks in advance.