Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 9d350b1

Browse files
drpicoxNarretz
authored andcommitted
feat(ngRef): 1. bind controllers to scope
1 parent ae428a0 commit 9d350b1

File tree

6 files changed

+369
-317
lines changed

6 files changed

+369
-317
lines changed

angularFiles.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ var angularFiles = {
5858
'src/ng/directive/attrs.js',
5959
'src/ng/directive/form.js',
6060
'src/ng/directive/input.js',
61-
'src/ng/directive/ngAs.js',
6261
'src/ng/directive/ngBind.js',
6362
'src/ng/directive/ngChange.js',
6463
'src/ng/directive/ngClass.js',
@@ -75,6 +74,7 @@ var angularFiles = {
7574
'src/ng/directive/ngNonBindable.js',
7675
'src/ng/directive/ngOptions.js',
7776
'src/ng/directive/ngPluralize.js',
77+
'src/ng/directive/ngRef.js',
7878
'src/ng/directive/ngRepeat.js',
7979
'src/ng/directive/ngShowHide.js',
8080
'src/ng/directive/ngStyle.js',
+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
@ngdoc error
2+
@name ngRef:badident
3+
@fullName Invalid identifier expression
4+
@description
5+
6+
Occurs when an invalid identifier is specified in an {@link ng.directive:ngRef ngRef} expression.
7+
8+
The {@link ng.directive:ngRef ngRef} directive's symbol syntax is used to assign a reference for the component controller in scope.
9+
10+
If the expression is not a simple identifier (such that you could declare it with `var {name}`, or if the expression is a reserved name,
11+
this error is thrown.
12+
13+
Reserved names include:
14+
15+
- `null`
16+
- `this`
17+
- `undefined`
18+
- `$parent`
19+
- `$id`
20+
- `$root`
21+
22+
Invalid expressions might look like this:
23+
24+
```html
25+
<my-component ng-ref="this"></my-component>
26+
<my-component ng-ref="some.objects["property"]"></my-component>
27+
<my-component ng-ref="$ctrl.propertyName"></my-component>
28+
<my-component ng-ref="resultOfSomeMethod()"></my-component>
29+
<my-component ng-ref="foo=6"></my-component>
30+
```
31+
32+
Valid expressions might look like this:
33+
34+
```html
35+
<my-component ng-ref="collections"></my-component>
36+
<my-component ng-ref="filteredCollection"></my-component>
37+
```

src/AngularPublic.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
scriptDirective,
1313
selectDirective,
1414
optionDirective,
15-
ngAsDirective,
1615
ngBindDirective,
1716
ngBindHtmlDirective,
1817
ngBindTemplateDirective,
@@ -29,6 +28,7 @@
2928
ngInitDirective,
3029
ngNonBindableDirective,
3130
ngPluralizeDirective,
31+
ngRefDirective,
3232
ngRepeatDirective,
3333
ngShowDirective,
3434
ngStyleDirective,
@@ -180,7 +180,6 @@ function publishExternalAPI(angular) {
180180
script: scriptDirective,
181181
select: selectDirective,
182182
option: optionDirective,
183-
ngAs: ngAsDirective,
184183
ngBind: ngBindDirective,
185184
ngBindHtml: ngBindHtmlDirective,
186185
ngBindTemplate: ngBindTemplateDirective,
@@ -196,6 +195,7 @@ function publishExternalAPI(angular) {
196195
ngInit: ngInitDirective,
197196
ngNonBindable: ngNonBindableDirective,
198197
ngPluralize: ngPluralizeDirective,
198+
ngRef: ngRefDirective,
199199
ngRepeat: ngRepeatDirective,
200200
ngShow: ngShowDirective,
201201
ngStyle: ngStyleDirective,

src/ng/directive/ngAs.js

-241
This file was deleted.

0 commit comments

Comments
 (0)