Good evening everyone! Tell me please is there any possibility to make a global variable inside the functions of the ES6 class? For example, pass $ scope and $ http to all the functions that are inside the class. That is, to actually get rid of this. $ Scope = $ scope and this. $ Http = $ http, etc. That in each function there was a variable $ scope and $ http without this.
import {AngularController} from '../core/AngularController'; class XCustomPageController extends AngularController { static $inject = ['$scope','$http']; constructor($scope, $http) { super($scope) $scope.name = "Input new name and click `Set` button" } setNewNameButtonClick(event) { this.$scope.name = event.target.value; } } export default {XCustomPageController};
this, orsuper. - Grundy