Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未捕获类型错误:mainApp.componet不是组件互连通信中的函数_Javascript_Angularjs - Fatal编程技术网

Javascript 未捕获类型错误:mainApp.componet不是组件互连通信中的函数

Javascript 未捕获类型错误:mainApp.componet不是组件互连通信中的函数,javascript,angularjs,Javascript,Angularjs,我想你有打字错误 这不是复杂的 但是 mainApp.componet('myPane',{ transclude:true, require:{ tabsCtrl:'^myTabs' }, bindings: { title: '@' }, controller:function() { this.$onInit = function() { this.tabsCtrl.addPane(th

我想你有打字错误

这不是复杂的

但是

mainApp.componet('myPane',{
    transclude:true,
    require:{
        tabsCtrl:'^myTabs'
    },
    bindings: {
      title: '@'
    },
    controller:function() {
      this.$onInit = function() {
        this.tabsCtrl.addPane(this);
        console.log(this);
      };
    },
    templateUrl: 'my-pane.html'

});
例如:

component
mainApp.component('myPane',{
    transclude:true,
    require:{
        tabsCtrl:'^myTabs'
    },
    bindings: {
      title: '@'
    },
    controller:function() {
      this.$onInit = function() {
        this.tabsCtrl.addPane(this);
        console.log(this);
      };
    },
    templateUrl: 'my-pane.html'

});