I am using Angular and trying to route to a page. It works everywhere but in the code below, when I try to route, I see the URL moving to the desired page but comes back to the same page from where it was triggered. I am not sure why is it behaving like this.
This is my HTML from where I call a method
<button ng-click="proposalForm()" >Request</button>
In my controller.js, I am just trying to route to a different page. When I click the button, it routes to the proposal page but quickly returns to the same from where I trigger this. Am I missing any? It works for me in all other places.
$scope.proposalForm = function() {
$location.path('/proposal');
}
When I try to access this using datatarget, it includes the JSP but when I try to route completely to a different page, it doesn't work. Is there any other way, I can route it to a different JSP.
Here is my router code, It has the correct path for proposal, I am not sure if it is routing to the default for some reason
Bid.config(function($routeProvider) {
.when('/proposal', {
templateUrl : '/Bid/proposal',
controller : 'homeController'
}).otherwise({
redirectTo : '/'
});
});