cengavera
cengavera

Reputation: 43

Angular Ng-click function does not work in button

I want to navigate from one page to another page when I'm click the 'Sorgula' button. I wrote ng-click function and add controller but doesn't work.

 [![enter image description here][1]][1]

enter image description here

enter image description here

enter image description here

Upvotes: 1

Views: 1315

Answers (3)

coder
coder

Reputation: 8712

Remove the href="" where you have use ng-click to navigate to another route

in your case I mark it in red circle.

enter image description here

Then in your go function add code like below

$scope.go = function(path) {
  $location.path(path);
}

Upvotes: 1

Wintergreen
Wintergreen

Reputation: 234

You can use $state.go use for navigate to another state.Dont forget to inject '$state' in controller eg:- $state.go("Tab1.Main");

Upvotes: 1

Aqdas
Aqdas

Reputation: 940

As per documentation for ngClick it requres expression to execute as mentioned in documentation

Instead of expression you are providing controller's action so You should probably use the ngHref directive along with the ngClick:

This solution is already provided at following link

Upvotes: 1

Related Questions