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 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.