My application assigns variables to the $scope in a controller, like $scope.myVariable = 123;
After I run Closure Compiler, that code gets turned into $scope.a = 123;
and $scope.b = 123;
and so on...
My html templates have things like <p>{{ myVariable }}</p>
I need to update the templates to <p>{{ a }}</p>
to match the new name of the renamed property myVariable.
I know that I can use the CC /** @expose */
annotation, or I can do something like $scope['myVariable'] = 123
so that CC does not rename that specific property. However, I would like to keep renaming the variable properties.
I have 2 options that I see:
Write a script that uses the _props_map.out from the CC, and write a script that sear-replaces the strings in my HTML.
Write my templates in javascript, so that CC will also process my templates, and then run the template function which spits out html of a template.
What would be the best way to keep renaming my variables and update the template html?
/** @export */
on all controllers' properties I use in the template, which is not ideal.