Try this:
var newlist = $scope.oldtags.concat($scope.newtags.map(function (tag) {
return {text: tag} }));
In place of line 20 or 22.
On 23 October 2014 15:47, Adrian Lynch <[email protected]>
wrote:
> var oldTags = [{text: 'xyz'}, {text: 'abc'}];
> var newTags = ['New!'];
> var combinedTags = oldTags.concat(newTags.map(function(tag) { return
> {text: tag} }));
>
> console.log(oldTags);
> console.log(newTags);
> console.log(combinedTags);
>
> Array.map is modern browser only. So you'll need to use jQuery's or
> underscore/lodash's version.
>
> Adrian
>
> On 23 October 2014 15:08, Ren Vile <[email protected]> wrote:
>
>> Old
>> [Object { text="SR-HD1250"}, Object { text="SR-HD1500"}, Object { text=
>> "SR-HD2500US"}]
>>
>>
>> New
>> ["XL-Z232"]
>>
>>
>>
>>
>> On Thursday, October 23, 2014 8:55:01 AM UTC-5, Adrian Lynch wrote:
>>>
>>> Console log new tags and old tags and post 'em here.
>>>
>>>
>>>
>>> --
>> 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/d/optout.
>>
>
>
--
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/d/optout.