fix(upgrade): fix upgrade component Closure optimization. (#14801)
$scope and $element are passed to AngularJS, which is not optimized together with the app. That means properties must be quoted to prevent renaming.
This commit is contained in:
parent
5ba55b0e04
commit
968995a4c6
|
@ -355,7 +355,8 @@ export class UpgradeComponent implements OnInit, OnChanges, DoCheck, OnDestroy {
|
||||||
controllerType: angular.IController, $scope: angular.IScope,
|
controllerType: angular.IController, $scope: angular.IScope,
|
||||||
$element: angular.IAugmentedJQuery, controllerAs: string) {
|
$element: angular.IAugmentedJQuery, controllerAs: string) {
|
||||||
// TODO: Document that we do not pre-assign bindings on the controller instance
|
// TODO: Document that we do not pre-assign bindings on the controller instance
|
||||||
const locals = {$scope, $element};
|
// Quoted properties below so that this code can be optimized with Closure Compiler.
|
||||||
|
const locals = {'$scope': $scope, '$element': $element};
|
||||||
const controller = this.$controller(controllerType, locals, null, controllerAs);
|
const controller = this.$controller(controllerType, locals, null, controllerAs);
|
||||||
$element.data(controllerKey(this.directive.name), controller);
|
$element.data(controllerKey(this.directive.name), controller);
|
||||||
return controller;
|
return controller;
|
||||||
|
|
Loading…
Reference in New Issue