Answer the question
In order to leave comments, you need to log in
How to call the controller from the console?
There is an application in angular. Assembled, works. There was a problem with the mozilla sdk event handling in order to package the application into a fox plugin.
An Angular application is built like this
// Mount on window for testing
window.app = angular.module('app', requires);
angular.module('app').constant('AppConstants', constants);
angular.module('app').config(appConfig);
angular.module('app').run(appRun);
angular.bootstrap(document, ['app'], {
strictDi: true
});
loginPanel.port.emit("load_page", someValue); // вызов события
self.port.on("load_page", function onShow(someValue) {
console.error(someValue);
// вот тут надо передать вызвать метод из класса контроллера и передать данные
});
class HomeCtrl {
constructor(User, Tags, AppConstants, $scope, Api, Storage) {
'ngInject';
console.log('contruct');
}
test(){
console.error('test method from home controller');
}
}
export default HomeCtrl;
window.app.controller('homeCtrl', ['$scope', function ($scope) {
}]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question