I'm trying to change variable in service but watch in controller does not trigger when that happens:
app.factory 'User', ->
class User
status: 'offline'
set_status: (status) ->
@status = status
app.service 'Account', ->
dsa: null
test: 'asd'
user: null
app.controller 'MainCtrl', ($scope, $timeout, Account, User) ->
Account.user = new User
$scope.$watch Account.user.status, (status) ->
console.log "status changed to #{status}"
$timeout ->
Account.user.set_status 'busy'
console.log Account.user.status
, 2000
Here is a plunk for this. What is the reason?