What am I missing?!
My html:
<div class="container-fluid" ng-controller="DashboardCtrl as dash">
<input ng-model="dash.customerId" />
{{ dash.customerId }}
</div>
My Controller:
(function () {
'use strict';
angular
.module('ngXmdDashboard')
.controller('DashboardCtrl', DashboardCtrl);
DashboardCtrl.$inject = [ 'Customers' ];
function DashboardCtrl( Customers ) {
var vm = this;
vm.customerId = 1;
var updateCustomers = function() {
vm.customerId = 2;
};
Customers.subscribe(updateCustomers);
})();
My Service:
(function () {
'use strict';
angular
.module('ngXmdDashboard')
.factory('Customers', Customers);
Customers.$inject = [ 'Data' ];
function Customers( Data ) {
return {
subscribe: subscribe
};
function subscribe(cb) {
cb();
}
}
})();
When I load the page, I'm not seeing 1 as my bound value in the view. When I look in dev tools, I see that dash.customerId is set correctly to 2.
I'm just getting back to using angular, and I'm stumping my toe on something dumb here. Sorry to bog down the board with a likely dumb questions. Thanks.