angularjs - ngRoute RouteController getting called only once -


I have an intelligence to show my setup.

The problem is that the controller function is only calling once on the page load, but then on changing the hash (link click As a result) the function routeController is not being called again.

My links have arisen in another NG module, it is not certain if the link should be in the same module with the router.

  & lt; Div id = "router" & gt; & Lt; Div ng-view & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; Div id = "navigation" data-ng-cloak & gt; & Lt; Ul id = "folios" data-ng-controller = "folios controller" class = "nav navel-pills nav-stack" & gt; & Lt; Li data-ng-repeat = "folio in folio" ng-class = "{active: iactive ('/ search / {{folio.product_id}}')} & gt; & Lt; A href = "# / search / {{folio.productId}}" & gt; {{Folio.title}} & lt; / A & gt; & Lt; / li & gt; & Lt; / Ul & gt; & Lt; Div ui-view & gt; & Lt; / Div & gt; & Lt; / Div & gt;   

Edit:

The problem is further diagnosed. Any list / anchor generated by the NG controller is not responding to the hash change outside the scope, while the fixed links are from the Plunkr link, "foo" and "bar" trigger the click controller but "abc" and "def "Are not. Review. The question is how to respond to changes in the form of "ABC" and "DEF" (dynamic link)

The code is intended as you coded it. You are calling the route controller in the controller's constructor, but it is not being done anymore (the router is not going to do this).

If you have to apply the paths to changing the paths to implement the code> route controller function on each path change:

$ route < / p>

Take a look at this plank note: I am compelled to change the state because you are using the ui-router instead of ngRoute.



Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -