Discussions

Ask a Question
Back to All

Problem double assign $jinqJs in AngularJS

I has declare variabel resultArea and resultType in controller angularJs 1.x. It is assigned array object use LINQ JinqJs. like follow this :

//grouping area
var resultArea = $jinqJs.from(tempArea).groupBy('Id', 'Name')
.count('HotelId')
.where(function (x) {
return x.Id != 0;
})
.select(function (x) {
var result = {
'Id': x.Id,
'Name': x.Name,
'Ck': false,
'myCount': x.HotelId
};
return result;
});
console.log(resultArea);
//grouping type
var resultType = $jinqJs.from(tempType).groupBy('Id', 'Name')
.count('HotelId')
.where(function (x) {
return x.Id != 0;
})
.select(function (x) {
var result = {
'Id': x.Id,
'Name': x.Name,
'Ck': false,
'myCount': x.HotelId
};
return result;
});
console.log(resultType);

My question is why when I view value in resultType rseultArea value too there?