Angular Js 的预览错误
plunker Error in preview for Angular Js
我一直在努力解决这个问题,想看看我是否遗漏了什么,我正在尝试学习 angular Js on plunker,突然间我收到了这个错误,我有对 Jquery 的引用,我之前认为这是 link 文件的顺序,所以将 Jquery 移到了 index.html 的顶部,现在错误消失了,但我得到一个包含以下错误的空白页。有人可以指出为什么我仍然得到这个吗?我收到以下错误
TypeError: undefined is not a function (evaluating 't.data.match(/at\-share\-bookmarklet\:(.+?)$/)')
有问题的部分是您的 app.js:
中有两个名为 StoreController
的控制器
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
变量。
我一直在努力解决这个问题,想看看我是否遗漏了什么,我正在尝试学习 angular Js on plunker,突然间我收到了这个错误,我有对 Jquery 的引用,我之前认为这是 link 文件的顺序,所以将 Jquery 移到了 index.html 的顶部,现在错误消失了,但我得到一个包含以下错误的空白页。有人可以指出为什么我仍然得到这个吗?我收到以下错误
TypeError: undefined is not a function (evaluating 't.data.match(/at\-share\-bookmarklet\:(.+?)$/)')
有问题的部分是您的 app.js:
中有两个名为StoreController
的控制器
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
变量。