1

我一直在试图弄清楚这一点,并想看看我是否遗漏了什么,我正在尝试在 plunker 上学习 angular Js,突然间我遇到了这个错误,我有对 Jquery 的引用,我之前认为它是链接文件的顺序,因此将 Jquery 移动到 index.html 的顶部,现在该错误消失了,但我得到一个空白页面,并出现以下错误。有人能指出为什么我仍然得到这个吗?我收到以下错误

TypeError: undefined is not a function (evaluating 't.data.match(/at\-share\-bookmarklet\:(.+?)$/)')

链接

4

1 回答 1

1

有问题的部分是StoreController您的 app.js 中有两个控制器:

app.controller('StoreController', function() {
  this.products = produce;
});

app.controller('StoreController', function() {
   this.tab = 1;

   this.selectTab = function(setTab) {
     this.tab = setTab;
   };

   this.isSelected = function(checkTab) {
     return this.tab === checkTab;
   };

});

重命名后一个(PanelController我猜,基于您在 plunker 中编写的其他内容),不再出现空白屏幕。

你遇到的是你的后者StoreController覆盖了你的第一个,从而使事情看起来很糟糕,因为你的后一个控制器中没有products变量。

于 2015-04-13T05:28:51.003 回答