I switched to using ES6 (Babel) in my new Angular project. ES6 classes cannot have variables. How do I set my $scope variable now??
Say I have a simple controller:
class MainController {
constructor ($timeout, events) {
'ngInject';
this.textMaker = "Hello!" //Option #1
} // constructor
textMaker(){ //Option #2
return "Hello!";
}
}
export default MainController;
My html looks like (controller is aut0matically injected during build, say):
<h1> {{textMaker}}</h1>
Both Option #1 and Option#2 don't seem to work. I get a blank heading. Such a simple thing.. what am i doing wrong?