I want to send a path by calling a function, by sending the path as function parameter.
However my controller code:
$scope.go = function(path){
alert(path); //show the path comes in as parameter
$location.path( path );
}
My view code (.html)
<button ng-click="go('/hotellist/{{topHeading}}?tab=packages')" ></button>
I have checked {{topheading}}
it gets the value of $scope.topheading
correctly, but when i am sending this using ng-click
it is getting no value at all! The alert is just saying '/hotelist/?tab=packages'
.
Any Idea? why this is happening?