1

I've looked at the following:

angularjs 'ng-href' not working

AngularJS ng-href does not go to link

Following code does not work either:

<div data-ng-controller="secureNavCtrl" class="container">
    <a data-ng-href="/signout">sign out</a>
</div>

The code above only changes the url in the browser, but does not actually change the page.

.controller('secureNavCtrl', ['$scope', '$window', '$location', '$cookies', function ($scope, $window, $location, $cookies) {
    }]);

Controller code is empty.

Does anyone know why this is not working? I don't seem to be the only one with this issue.

basickarl
  • 37,187
  • 64
  • 214
  • 335

1 Answers1

0

You should be using ng-href and ng-controller

without the "data-" prefix. also have you setted up an ng-app in the begging of the html?

menta man
  • 66
  • 9
  • Wrong. It's good practice as it helps validation of your html. Indeed I have `data-ng-app` at the top! Everything works, just this :/ – basickarl Sep 23 '15 at 19:48
  • I do not have any routes actually. The only thing I'm using angularjs atm is to submit a form. – basickarl Sep 23 '15 at 19:54
  • and if you go directly to this route, not with ng-href it works? directly to site.com/signout and refresh – menta man Sep 23 '15 at 19:55