I am currently working on a basic app for demonstration purposes, and I have encountered the following issue: I have two objects in my controller (credentials and authServer) and I want to access the properties of credentials within the authServer object. The input fields bound to both scope.credential properties do not update when changed in my authServer object.
While I know that I can use $watch to solve this problem, I am seeking a more elegant solution.
var app = angular.module('clientApp', []);
app.controller('myCtrl', function($scope) {
$scope.credentials = {
'username': null,
'password' : null
};
$scope.authServer = {
'url' : 'http://localhost:9000/auth',
'request' : {
'grant_type': null,
'scope': null,
'client_id': null,
'client_secret': null,
'username' : $scope.credentials.username,
'password' : $scope.credentials.password
}
};
});