AngularJS ng-repeat don't see scope variable - in WYSIWYG editor loaded with AJAX? -
i'm modifying website, built angularjs, , in 1 page have wysiwyg editor.
the whole widget includes editor, div has 'ng-controller="textscontroller"'.
in div have button, clicking on displays editor. , initializing of editor happens in directive - "richtexteditor".
so - i'm making popup in editor, has show images server. put code pulling images in controller ... , there set
$http.get('/url/to/files').success(function(data) { $scope.imagesfromserver = data; });
and in view have
'ng-repeat="image in imagesfromserver"'
and problem ngrepeat doesn't see items.
i have 2 ideas:
the view, containing ngrepeat (the html editor, , popup images well) loads ajax, , @ moment scope variable not set.
i'm initializing scope variable in wrong place. (eventually has in directive instead of controller? ... examples i've seen , done far - pull every data in controller, , view sees directly.)
hope i've described situation clearly.
thanks in advance.
Comments
Post a Comment