ionic中都是直接写$scope.$on和$scope.$broadcast方法。现在ES6中推荐用this,不会写了。上代码:
class TagsCtrl {
// @ngInject
constructor($scope) {
_.assign(this, {$scope});
}
}
export default TagsCtrl;
如果想在上边这段代码中加个$on的监听事件,要如何写,如何触发?如果把$on的监听事件写在constructor中,外部并不能触发,求解!!!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
参考文档:链接描述