Thanks for your reply,

this.userdata is a json object come from my serveur

So, I have a list of user, I would like to update the list after 
add/change/delete a user ... I try to use setInterval() but it's impossible 
to use this, there to many request is send to my serveur.

I would like a update my view after change ... how could I do this please ?

thanks a lot

Le lundi 1 février 2021 à 11:17:06 UTC+1, bastien...@gmail.com a écrit :

> *this.route.params.subscribe*
>  This is used to listen to changes to the route params. Calling the 
> function a second time will just create a new subscription meaning the data 
> will now refresh twice instead of once when route.params changes.
>
> you're not using the data sent by route.params, it seems you don't need it 
> at all... what is this.userData, where does it come from?
>
>
>
> *Bastien Lemaire*
>
>
> On Mon, 1 Feb 2021 at 11:01, Zako <j.min...@gmail.com> wrote:
>
>> Hi,  I am new here and new and angular. Could you help me please ?
>>
>> I would like to use a function from another function but it doesn't work
>>
>> In my function "updateData", I try to re-call my function "getInitData" 
>> but it don't work.
>> Have you got an idea please ?
>>
>>
>> *ngOnInit() { *
>> *     this.getInitData(); *
>> * } *
>>
>> *getInitData() { *
>> *     this.route.params.subscribe((params: Params) => { 
>> this.model=this.userData; }); *
>> * }  *  
>>
>> *updateData() { *
>> *     //code to update my data ... here it's ok*
>> *     this.getInitData(); *
>> * } *
>>
>>
>> Thanks a lot
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Angular and AngularJS discussion" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to angular+u...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/angular/91350bfb-3723-4be6-ab28-aea392fdffccn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/angular/91350bfb-3723-4be6-ab28-aea392fdffccn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/935361b3-ad47-4a72-a92b-f083405d1acfn%40googlegroups.com.

Reply via email to