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 My links have arisen in another NG module, it is not certain if the link should be in the same module with the router. 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 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. routeController is not being called again.
& 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;
route controller in the controller's constructor, but it is not being done anymore (the router is not going to do this).
Comments
Post a Comment