简体   繁体   English

Ionic / AngularJS / Instafeed无法访问范围

[英]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. 以下在AngularJS中添加到我的控制器中的代码可在纯AngularJS中使用。

In Ionic though, the same code snippet doesn't work. 但是在Ionic中,相同的代码段不起作用。 tagName remains undefined. tagName保持未定义。 And in this case, I cannot access the scope value. 在这种情况下,我无法访问范围值。 If I change the tagName to something like 'cat' it pulls instagram photos successfully. 如果我将tagName更改为“ cat”之类的内容,则会成功提取instagram照片。 Any thoughts on how to be able to access the scope? 关于如何访问示波器有任何想法吗?

Error: No tag name specified. 错误:未指定标签名称。 Use the 'tagName' option. 使用“ tagName”选项。

  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. 对于遇到此问题的任何人,我都为Instafeed创建了一个简单的轻型角形包装器。 You can find it with instructions and a demo which uses $scope variables bound via ngModel at https://github.com/zephinzer/ngInstafeed . 您可以在https://github.com/zephinzer/ngInstafeed上找到带有说明和使用通过ngModel绑定的$ scope变量的演示的示例。 Cheers! 干杯!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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