简体   繁体   中英

Ionic/AngularJS/Instafeed can't access scope

My question is for Ionic. The following code added to my controller in AngularJS works in pure AngularJS.

In Ionic though, the same code snippet doesn't work. tagName remains undefined. And in this case, I cannot access the scope value. If I change the tagName to something like 'cat' it pulls instagram photos successfully. Any thoughts on how to be able to access the scope?

Error: No tag name specified. Use the 'tagName' option.

  var feed = new Instafeed({
    get: 'tagged',
    tagName: $scope.artists.instagram,
    clientId: 'xxxxxxxxxxxxxxxxx',
    resolution : 'standard_resolution'
  });

  feed.run();

For anyone coming across this problem, I've created a simple lightweight angular wrapper for Instafeed. You can find it with instructions and a demo which uses $scope variables bound via ngModel at https://github.com/zephinzer/ngInstafeed . Cheers!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM