8000 Rename controller as reference name in directive scope · packetloop/angular-webpack@3c7f70c · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 21, 2019. It is now read-only.

Commit 3c7f70c

Browse files
committed
Rename controller as reference name in directive scope
1 parent 69f0302 commit 3c7f70c

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/app/about/about.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<div>{{this.name}}</div>
1+
<div>{{controller.name}}</div>

src/app/about/about_directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var $inject = [];
44
var about = function () {
55
return {
66
controller: 'AboutController',
7-
controllerAs: 'this',
7+
controllerAs: 'controller',
88
template: require('./about.html')
99
};
1010
};

src/app/home/home.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div>{{home.name}}</div>
1+
<div>{{controller.name}}</div>
22

33
<div>
44
HelloDirective:

src/app/home/home_directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var $inject = [];
66
var home = function () {
77
return {
88
controller: 'HomeController',
9-
controllerAs: 'home',
9+
controllerAs: 'controller',
1010
template: require('./home.html')
1111
};
1212
};

0 commit comments

Comments
 (0)
0