【发布时间】:2019-09-22 08:55:18
【问题描述】:
我有一个内部有函数的组件:
app.component("myComponent", {
templateUrl: "myComponent.html",
controller: function() {
this.addApp = function (arg) {
console.log(arg);
};
}
})
我想从组件外部操作该功能:
<my-component>
</my-component>
<button type="button" ng-click="something.addApp('Cheese')"
class="btn-sm btn-default no-modal" >
Add Application
</button>
怎么做?
【问题讨论】:
标签: angularjs angularjs-components