Answer the question
In order to leave comments, you need to log in
What is the problem with the controller?
There is a controller
app.controller 'UserCtrl', ["localData", (localData) ->
self = this
self.data = localData.user// данные
self.icons = localData.icons // данные
]
User = localData.icons
, not User.icons = localData.icons app.controller 'UserCtrl', ["localData", (localData) ->
self = this
self.data = localData.user
self.icons = localData.icons
self.name = 'some name'
]
Answer the question
In order to leave comments, you need to log in
deal with closures in your coffeescript. They implicitly return values, as far as I remember.
You do not register a controller in Angular, but a controller constructor. And constructors in js can return anything if you explicitly return.
To understand what went wrong, take a look at the generated code. I'm sure there will be something along the lines of:return self.icons = localData.icons.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question