Okay, I have to compare mat treeview this._objectData to the unchanged 
backend service data.to see if there was a change..
below is the applyObjects script that saves the treeview for reports and 
workflow:
  objectsApply() {
        this._objectsData = {
            id: this._selectedRole.id,
            name: this._selectedRole.name,
            features: this._selectedRole.features,
            objects: this.objectSelectedValues
              
        }; 

loadTreedata() {
     
        this.rmService.getObjects().subscribe(res => {
            console.log('Get Objects Results '+ JSON.stringify(res));
          
            
            res.map(item => {
                if (item.type == "WORKFLOW") {
                    let treeviewItems = 
item.objects[0].objects[0].objects.map(object => {
                        const data = {
                            text: object.name,
                            value: object.id
                        };
                        return data;
                        
                    });
                    this.objectItem.push(new TreeviewItem({
                        text: item.type,
                        value: 1,
                        collapsed: false,
                        children: [{
                            text: item.objects[0].type,
                            value: item.id,
                            children: [{
                                text: item.objects[0].objects[0].type,
                                value: item.id,
                                children: treeviewItems,
                            }],
                        }],

                    }));
                  
                }

                if (item.type == "REPORTS") {
                    let treeviewItems = item.objects[0].objects.map(object 
=> {
                        const data = {
                            text: object.name,
                            value: object.id
                        };
                        return data;
                    });
                    this.objectItem.push(new TreeviewItem({
                        text: item.type,
                        value: 0,
                        collapsed: false,
                        children: [{
                            text: item.objects[0].type,
                            value: item.id,
                            children: treeviewItems,
                        }],
                    }));
                }
            });
        });

Maybe I'm missing something but I don't get where to get the original 
backend data? to compare with the new value of this._objectDAta???
thanks,

On Friday, June 28, 2019 at 1:09:13 AM UTC-4, Sander Elias wrote:
>
> Hi J,
>
> I'm unsure what your question is. Did I understand it correctly that you 
> want to read out and parse back objectitem?
>
> Regards
> Sander
>

-- 
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 post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular/bb2efe8e-7a52-4bb6-a415-94c89f8f3cea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to