How to operate functions of component controllers from outside
问题 I have a component with a function inside: app.component("myComponent", { templateUrl: "myComponent.html", controller: function() { this.addApp = function (arg) { console.log(arg); }; } }) I would like to operate that function from outside the component: <my-component> </my-component> <button type="button" ng-click="something.addApp('Cheese')" class="btn-sm btn-default no-modal" > Add Application </button> How to do that? 回答1: To access functions of component controllers, use the ng-ref