How do you call an AngularJS $scope.Function from href?
angularjs, html, javascript
Solution
Just use `ngClick` like @Mike says. I don't see the reason to use angular in `href` .
Something like:
<a href="" ng-click="ActiveChange('topStories');">Top Stories</a>
Or leave it empty:
<a href ng-click="ActiveChange('topStories');">Top Stories</a>
Problem
The following works to call a function ActiveChange(variable) from a ``` a(href="javascript: ActiveChange('topStories');") Top Stories ``` But if the function is defined as an AngularJS $scope function such as ``` function activeController ($scope) { $scope.topStories='active'; $scope.mostRecent='lucky'; $scope.ActiveChange = function (activeTab) { if(activeTab=='topStories'){ var x=document.getElementById("someinput"); x.value='happy to be alive'; $scope.topStories='active'; $scope.mostRecent=''; } else { alert('else'); $scope.topStories='happy'; $scope.mostRecent='active'; } } } ``` How do you call $scope.ActiveChange = function (activeTab) from the ?