Hi i have two attributes in lightning component which is of type ID[]. In one attribute i am setting id's and in another attribute i am pushing these values, which i want to use later.
In a method i am making empty my first attribute, due to which my second attribute is also getting empty which shouldn't be ideally.
<aura:attribute name="UserId" type="Id[]"/>
<aura:attribute name="UserIdd" type="Id[]"/>
//pushing the values
component.set("v.UserIdd" , []);
var Users = [];
var us = component.get("v.UserId");
for(var i=0; i< us.length; i++)
{
Users.push(us[i]);
}
component.set("v.UserIdd", Users);
//making empty
var userlis = component.get("v.UserId");
if(userlis != null)
{
userlis.splice(0,userlis.length);
}