1.- Setting up ng-route
is straightforward. I have 3 buttons that navigate to different paths.
2.- There is a parent controller and a child controller for ng-view
.
3.- In the ng-view
template, there are spans bound to properties like subCtrl.id
and 'subCtrl.something'
. The initial values are set as something.id=1
and something.name='blondie'
.
4.- When calling the SignalR method through Fiddler at the initial route, everything works fine as it updates the view with 'Angel Eyes'.
ISSUE: However, if I change the route by selecting option 2 or 3 and call the SignalR method via Fiddler, the client receives the update and console logs 'Angel eyes', but the view does not get updated!
HTML
<div ng-app="app">
<div ng-controller="mainCtrl as ctrl">
<button ng-click="ctrl.optionSelected(1)">1</button>
<button ng-click="ctrl.optionSelected(2)">2</button>
<button ng-click="ctrl.optionSelected(3)">3</button>
<div ng-view></div>
</div>
...
The overall code structure may seem lengthy, but the problem lies in a simple issue. Please refer to the following demonstration:
Functionality on the initial route:
https://i.sstatic.net/JpAer.gif
Failure to update after changing views:
https://i.sstatic.net/t6SQa.gif
Any insights on what could be causing this discrepancy?