That works too, if you are planning to only read it. You could use run
block to execute some logic, and assign constant.




----------------------------

*Alesei Narkevitch* / [email protected] / *224.392.2592*



linkedin.com/in/aleseinarkevitch

github.com/gnrlbzik

twitter.com/gnrlbzik

stackoverflow.com/users/201244/gnrlbzik

forrst.me/gnrlbzik/posts

coderwall.com/gnrlbzik

coderbits.com/gnrlbzik


On Fri, Feb 14, 2014 at 1:10 AM, Pushpendra Kumar
<[email protected]>wrote:

> Thanks a lot guys.
>
> What about the use of app.costant("myVars", {"a":12, "b":2});
> I want that once my first call goes to back end and fetch response, I want
> to keep this response in whole app.
>
>
> Pushpendra
>
>
> On 14 February 2014 09:20, Alesei N <[email protected]> wrote:
>
>> You can write to so called "config" after you injected it.
>>
>> Initial post asks how to set global variables, this is one way to do
>> this, as this will be available through out app any where you inject it.
>>
>> you could also approach this through.
>>
>> app.run(function ($rootScope) {
>>     $rootScope.someData = {message: "hello"};});
>>
>>
>>
>>
>> On Thursday, February 13, 2014 6:29:53 PM UTC-6, Raul Vieira wrote:
>>
>>> Yes I get that login is not core.  My point was regarding the
>>> requirement of a login interaction.  What was described was setting globals
>>> in this interaction.  This implies after app bootstrapping.  How can you
>>> use config in this scenario?
>>>
>>> I agree that using a value makes sense, but not in the use case
>>> described.  Did I misunderstand the request?
>>>
>>> Raul
>>>
>>> Sent from my iPhone
>>>
>>> > On Feb 13, 2014, at 6:48 PM, Martin Alix <[email protected]> wrote:
>>> >
>>> > Angular does not have a concept of login, that is something you have
>>> to implement yourself...
>>> >
>>> > .value('config',{}) will be set as soon as the application starts and
>>> available anywhere it is injected.
>>> > It just happens to be named config in this example, it could be named
>>> anything, for example .value('foo',{bar:'baz'})
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google
>>> Groups "AngularJS" group.
>>> > To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> > To post to this group, send email to [email protected].
>>> > Visit this group at http://groups.google.com/group/angular.
>>> > For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "AngularJS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/angular.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>
>  --
> You received this message because you are subscribed to a topic in the
> Google Groups "AngularJS" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/angular/wMjutZlWq54/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to