Problem with localstorage

39 views
Skip to first unread message

Genís Jansà

unread,
Jul 17, 2014, 6:13:42 AM7/17/14
to ang...@googlegroups.com
Hi

I'm nooooob with angularjs.

I have this code:


function TestController($scope) {


$scope.objInf = [

{

id: 10,
sonido: "url",
imagen: "url",


}]

}


ObjInf have an object, but i need add more objects. I see a code with function addObject in $scope, for simple push() new object in objInf array, but this dunction is in testController, and this are executed in view,(index.html).

I put function out of testcontroller for add objects, but he say me that $scope dont exist. 

I need this for give the localstorage, and create after any objects:



var new = newObject; //maked for the local storage.

$scope.objInf.push(new);


Thanks!! and excuse my english!!! ;)



Jennifer Beuses

unread,
Jul 17, 2014, 12:12:34 PM7/17/14
to ang...@googlegroups.com

Genís Jansà

unread,
Jul 17, 2014, 12:17:27 PM7/17/14
to ang...@googlegroups.com
A lot of thanks!!!!!! ;)


--
You received this message because you are subscribed to a topic in the Google Groups "AngularJS" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/angular/xaUCuVFgs04/unsubscribe.
To unsubscribe from this group and all its topics, send an email to angular+u...@googlegroups.com.
To post to this group, send email to ang...@googlegroups.com.
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages