I am starting to try and get my head around the ng way..so forgive my noob 
Q.
I have a basic controller which is looking after a part of my demo 
site<http://landed1.github.io/videos.html>which can be seen here or the source 
on github 
https://github.com/landed1/landed1.github.io.

my question: I don't want to pass in the long text strings into the 
controller how I currently have my method

$scope.swapVideo=function($vid,$vidno,$header,$blurb){...

<a class="btn btn-default" href="#" 
ng-click="swapVideo('OcCK9HkZWCg',2,'Giovanni 
and COD','My very first gamer dj video - hope you like the track and that 
you want to share.')" role="button">Load This &raquo;</a>

So I wanted to place this text perhaps initially simply as a JSON Object 
then eventually create an ajax service call for this data perhaps from a 
database. So I was thinking of making an object for it thus.

var videoStore={[
{id:"0",vId:"OcCK9HkZWCg",niceNumber:2,title:"Giovanni and COD",blurb:"My 
very first gamer dj video - hope you like the track and that you want to 
share."},
{id:"1"},
{id:"2"} //etc
]
}

I realise that I don't probably want this in the controller. Where should 
it go and how can I make it so the controller can access it with something 
like
$scope.videoStore[0]

thanks for advice.

-- 
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/groups/opt_out.

Reply via email to