Assuming this is fairly simple fix and something that I've completely missed on my part..
I basically have a button where when the user clicks on it, it will go to a new state using ui-router. Immediately following the state change, a value from the script will cause the empty value of a simple paragraph tag to populate with a value I've set in the $scope in the script.
This isn't working, please see below example:
Script
app.controller('myCtrl', ['$scope', 'Auth', '$state', '$timeout',
function($scope, Auth, $state, $timeout) {
$scope.buttonClick = function () {
$state.go('newState');
$timeout(function () {
$scope.newValue = 'Hello';
}, 1000);
};
}]);
HTML
<p>{{newValue}}</p>
Now, I've tried various combinations already and have noticed that by taking the line '$scope.newValue = 'Hello';' and placing this outside the button click function will cause it to work fine. Yet, I am creating an application where there will be further button click events that each change the same value to a specific value that is applicable to the button click event.
$scope.newValueinnewState?