@@ -942,7 +942,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
942
942
* registered controller} if passed as a string. An empty `noop` function by default.
943
943
* - `controllerAs` – `{string=}` – identifier name for to reference the controller in the component's scope.
944
944
* If present, the controller will be published to scope under the `controllerAs` name.
945
- * If not present, this will default to be the same as the component name .
945
+ * If not present, this will default to be `$ctrl` .
946
946
* - `template` – `{string=|function()=}` – html template as a string or a function that
947
947
* returns an html template as a string which should be used as the contents of this component.
948
948
* Empty string by default.
@@ -988,14 +988,14 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
988
988
* ```js
989
989
* var myMod = angular.module(...);
990
990
* myMod.component('myComp', {
991
- * template: '<div>My name is {{myComp .name}}</div>',
991
+ * template: '<div>My name is {{$ctrl .name}}</div>',
992
992
* controller: function() {
993
993
* this.name = 'shahar';
994
994
* }
995
995
* });
996
996
*
997
997
* myMod.component('myComp', {
998
- * template: '<div>My name is {{myComp .name}}</div>',
998
+ * template: '<div>My name is {{$ctrl .name}}</div>',
999
999
* bindings: {name: '@' }
1000
1000
* });
1001
1001
*
@@ -1066,7 +1066,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
1066
1066
var template = ( ! options . template && ! options . templateUrl ? '' : options . template ) ;
1067
1067
return {
1068
1068
controller : options . controller || function ( ) { } ,
1069
- controllerAs : identifierForController ( options . controller ) || options . controllerAs || name ,
1069
+ controllerAs : identifierForController ( options . controller ) || options . controllerAs || '$ctrl' ,
1070
1070
template : makeInjectable ( template ) ,
1071
1071
templateUrl : makeInjectable ( options . templateUrl ) ,
1072
1072
transclude : options . transclude ,
0 commit comments