javascript - Dynamic variable name of scope -


I tried to define foreach Koniyriyj a dynamic variable names do, such as:

 < code> Angular.for each ($ scope.posts, function (item) {// counter increment counter ++; var idPage = 'feed' + counter; Feedsewa. Piarafaf (URL). then (function (res) {$ Scope.window [idPage] = Res.data.responseData.feed.entries;});});  

So, it does not work and I have this error: can not set property is undefined to feed 1 '

< P> What is the correct syntax?

What is the window property in your $ Scope object? If so, go with Maxim's answer. If not, try:

  Angular. ForEach ($ scope.posts, function (item) {// counter increment counter ++; var idPage = 'feed' + counter; FeedService.parseFeed (url). Then (function (res) {$ scope [Aideepej] = Res.data.responseData.feed.entries;});});  

Editing:

Performance:


Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Messages from .properties file do not display UTF-8 characters -

javascript - amcharts makechart not working -