diff --git a/src/lib/input/index.ts b/src/lib/input/index.ts index d0a7d8a6532f..299e690c2179 100644 --- a/src/lib/input/index.ts +++ b/src/lib/input/index.ts @@ -1,5 +1,12 @@ -import {NgModule, ModuleWithProviders} from '@angular/core'; -import {MdPlaceholder, MdInputContainer, MdHint, MdInputDirective} from './input-container'; +import {ModuleWithProviders, NgModule} from '@angular/core'; +import { + MdHint, + MdInputContainer, + MdInputDirective, + MdPlaceholder, + MdPrefix, + MdSuffix +} from './input-container'; import {MdTextareaAutosize} from './autosize'; import {CommonModule} from '@angular/common'; import {FormsModule} from '@angular/forms'; @@ -12,7 +19,9 @@ import {PlatformModule} from '../core/platform/index'; MdInputContainer, MdHint, MdTextareaAutosize, - MdInputDirective + MdInputDirective, + MdPrefix, + MdSuffix, ], imports: [ CommonModule, @@ -24,7 +33,9 @@ import {PlatformModule} from '../core/platform/index'; MdInputContainer, MdHint, MdTextareaAutosize, - MdInputDirective + MdInputDirective, + MdPrefix, + MdSuffix, ], }) export class MdInputModule { diff --git a/src/lib/input/input-container.html b/src/lib/input/input-container.html index cefe5a06f8d1..249900e8c67a 100644 --- a/src/lib/input/input-container.html +++ b/src/lib/input/input-container.html @@ -1,6 +1,6 @@
-
+
@@ -23,7 +23,7 @@
-
+
diff --git a/src/lib/input/input-container.ts b/src/lib/input/input-container.ts index d11b5a67f207..3a89dd5a8334 100644 --- a/src/lib/input/input-container.ts +++ b/src/lib/input/input-container.ts @@ -73,6 +73,20 @@ export class MdHint { } +/** The input prefix. */ +@Directive({ + selector: '[mdPrefix], [matPrefix], [md-prefix]' +}) +export class MdPrefix {} + + +/** The input suffix. */ +@Directive({ + selector: '[mdSuffix], [matSuffix], [md-suffix]' +}) +export class MdSuffix {} + + /** The input directive, used to mark the input that `MdInputContainer` is wrapping. */ @Directive({ selector: `input[mdInput], textarea[mdInput], input[matInput], textarea[matInput]`, @@ -290,6 +304,10 @@ export class MdInputContainer implements AfterContentInit { @ContentChildren(MdHint) _hintChildren: QueryList; + @ContentChildren(MdPrefix) _prefixChildren: QueryList; + + @ContentChildren(MdSuffix) _suffixChildren: QueryList; + ngAfterContentInit() { if (!this._mdInputChild) { throw new MdInputContainerMissingMdInputError();