X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ const controlGroupProvider =
* template: `
* <div>
* <h2>Angular2 Control &amp; ControlGroup Example</h2>
* <form #f="form">
* <div ng-control-group="name" #cg-name="form">
* <form #f="ngForm">
* <div ng-control-group="name" #cg-name="ngForm">
* <h3>Enter your name:</h3>
* <p>First: <input ng-control="first" required></p>
* <p>Middle: <input ng-control="middle"></p>
Expand Down Expand Up @@ -73,7 +73,7 @@ const controlGroupProvider =
selector: '[ng-control-group]',
providers: [controlGroupProvider],
inputs: ['name: ng-control-group'],
exportAs: 'form'
exportAs: 'ngForm'
})
export class NgControlGroup extends ControlContainer implements OnInit,
OnDestroy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ const controlNameBinding =
* selector: "login-comp",
* directives: [FORM_DIRECTIVES],
* template: `
* <form #f="form" (submit)='onLogIn(f.value)'>
* Login <input type='text' ng-control='login' #l="form">
* <form #f="ngForm" (submit)='onLogIn(f.value)'>
* Login <input type='text' ng-control='login' #l="ngForm">
* <div *ng-if="!l.valid">Login is invalid</div>
*
* Password <input type='password' ng-control='password'>
Expand Down Expand Up @@ -93,7 +93,7 @@ const controlNameBinding =
bindings: [controlNameBinding],
inputs: ['name: ngControl', 'model: ngModel'],
outputs: ['update: ngModelChange'],
exportAs: 'form'
exportAs: 'ngForm'
})
export class NgControlName extends NgControl implements OnChanges,
OnDestroy {
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/src/common/forms/directives/ng_form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const formDirectiveProvider =
* <div>
* <p>Submit the form to see the data object Angular builds</p>
* <h2>NgForm demo</h2>
* <form #f="form" (ng-submit)="onSubmit(f.value)">
* <form #f="ngForm" (ng-submit)="onSubmit(f.value)">
* <h3>Control group: credentials</h3>
* <div ng-control-group="credentials">
* <p>Login: <input type="text" ng-control="login"></p>
Expand Down Expand Up @@ -84,7 +84,7 @@ const formDirectiveProvider =
'(submit)': 'onSubmit()',
},
outputs: ['ngSubmit'],
exportAs: 'form'
exportAs: 'ngForm'
})
export class NgForm extends ControlContainer implements Form {
form: ControlGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const formControlBinding =
bindings: [formControlBinding],
inputs: ['form: ngFormControl', 'model: ngModel'],
outputs: ['update: ngModelChange'],
exportAs: 'form'
exportAs: 'ngForm'
})
export class NgFormControl extends NgControl implements OnChanges {
form: Control;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const formDirectiveProvider =
inputs: ['form: ng-form-model'],
host: {'(submit)': 'onSubmit()'},
outputs: ['ngSubmit'],
exportAs: 'form'
exportAs: 'ngForm'
})
export class NgFormModel extends ControlContainer implements Form,
OnChanges {
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/common/forms/directives/ng_model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const formControlBinding =
bindings: [formControlBinding],
inputs: ['model: ngModel'],
outputs: ['update: ngModelChange'],
exportAs: 'form'
exportAs: 'ngForm'
})
export class NgModel extends NgControl implements OnChanges {
/** @internal */
Expand Down
4 changes: 2 additions & 2 deletions modules/angular2/test/common/forms/integration_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ export function main() {
// {{x.valid}} used to crash because valid() tried to read a property
// from form.control before it was set. This test verifies this bug is
// fixed.
var t = `<form><div ng-control-group="x" #x="form">
var t = `<form><div ng-control-group="x" #x="ngForm">
<input type="text" ng-control="test"></div>{{x.valid}}</form>`;
var fixture: ComponentFixture;
tcb.overrideTemplate(MyComp, t).createAsync(MyComp).then(
Expand Down Expand Up @@ -1072,4 +1072,4 @@ function sortedClassList(el) {
var l = DOM.classList(el);
ListWrapper.sort(l);
return l;
}
}
2 changes: 1 addition & 1 deletion modules/playground/src/model_driven_forms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ShowError {
template: `
<h1>Checkout Form (Model Driven)</h1>

<form (ng-submit)="onSubmit()" [ng-form-model]="form" #f="form">
<form (ng-submit)="onSubmit()" [ng-form-model]="form" #f="ngForm">
<p>
<label for="firstName">First Name</label>
<input type="text" id="firstName" ng-control="firstName">
Expand Down
2 changes: 1 addition & 1 deletion modules/playground/src/template_driven_forms/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class ShowError {
template: `
<h1>Checkout Form</h1>

<form (ng-submit)="onSubmit()" #f="form">
<form (ng-submit)="onSubmit()" #f="ngForm">
<p>
<label for="firstName">First Name</label>
<input type="text" id="firstName" ng-control="firstName" [(ng-model)]="model.firstName" required>
Expand Down
X Tutup