Skip to content
This repository has been archived by the owner on Feb 2, 2019. It is now read-only.

Commit

Permalink
fix(input): input elements must use md-input attribute to be recognized
Browse files Browse the repository at this point in the history
 - This is because a selector that finds the parent md-input-container is not supported fully by ng2.
 - update tabs demo to use md-input attributes.

BREAKING:

You must now put a md-input attribute on input elements inside of md-input-container in order to get material style support for them.

`<input md-input type="text">`
  • Loading branch information
justindujardin committed Jan 2, 2016
1 parent e691ec4 commit e00d578
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/components/tabs/dynamic_tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ <h2 class="md-subhead">
</div>
<md-input-container>
<label for="label">Label</label>
<input type="text" id="label" [(ngModel)]="tTitle">
<input md-input type="text" id="label" [(ngModel)]="tTitle">
</md-input-container>
<md-input-container>
<label for="content">Content</label>
<input type="text" id="content" [(ngModel)]="tContent">
<input md-input type="text" id="content" [(ngModel)]="tContent">
</md-input-container>
<button md-raised-button class="add-tab md-primary" [disabled]="!tTitle || !tContent" type="submit">Add Tab
</button>
Expand Down
3 changes: 2 additions & 1 deletion ng2-material/components/input/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export class MdInputContainer implements AfterContentChecked {


@Directive({
selector: 'md-input-container input',
selector: 'input[md-input],input.md-input',
providers: [MdInputContainer],
host: {
'class': 'md-input',
'(input)': 'updateValue($event)',
Expand Down

0 comments on commit e00d578

Please sign in to comment.