chore(templates): import required directives for ionic templates

This commit is contained in:
Adam Bradley
2016-07-01 00:59:37 -05:00
parent 009d5a980a
commit 656426672c
27 changed files with 266 additions and 217 deletions

View File

@ -1,5 +1,6 @@
import { Component, Optional, ElementRef, ViewChild, ViewEncapsulation } from '@angular/core';
import { NgControl } from '@angular/forms';
import { NgIf } from '@angular/common';
import { NgControl, NgModel } from '@angular/forms';
import { App } from '../app/app';
import { Config } from '../../config/config';
@ -74,15 +75,13 @@ import { Platform } from '../../platform/platform';
*/
@Component({
selector: 'ion-input',
template:
'<input [type]="type" [(ngModel)]="_value" (blur)="inputBlurred($event)" (focus)="inputFocused($event)" [placeholder]="placeholder" class="text-input">' +
'<input [type]="type" aria-hidden="true" next-input *ngIf="_useAssist">' +
'<button clear [hidden]="!clearInput" type="button" class="text-input-clear-icon" (click)="clearTextInput()" (mousedown)="clearTextInput()"></button>' +
'<div (touchstart)="pointerStart($event)" (touchend)="pointerEnd($event)" (mousedown)="pointerStart($event)" (mouseup)="pointerEnd($event)" class="input-cover" tappable *ngIf="_useAssist"></div>',
directives: [
NextInput,
NativeInput,
],
template: `
<input [type]="type" [(ngModel)]="_value" (blur)="inputBlurred($event)" (focus)="inputFocused($event)" [placeholder]="placeholder" class="text-input">
<input [type]="type" aria-hidden="true" next-input *ngIf="_useAssist">
<button clear [hidden]="!clearInput" type="button" class="text-input-clear-icon" (click)="clearTextInput()" (mousedown)="clearTextInput()"></button>
<div (touchstart)="pointerStart($event)" (touchend)="pointerEnd($event)" (mousedown)="pointerStart($event)" (mouseup)="pointerEnd($event)" class="input-cover" tappable *ngIf="_useAssist"></div>
`,
directives: [NativeInput, NextInput, NgIf, NgModel],
encapsulation: ViewEncapsulation.None,
})
export class TextInput extends InputBase {
@ -170,10 +169,7 @@ export class TextInput extends InputBase {
'<textarea [(ngModel)]="_value" (blur)="inputBlurred($event)" (focus)="inputFocused($event)" [placeholder]="placeholder" class="text-input"></textarea>' +
'<input type="text" aria-hidden="true" next-input *ngIf="_useAssist">' +
'<div (touchstart)="pointerStart($event)" (touchend)="pointerEnd($event)" (mousedown)="pointerStart($event)" (mouseup)="pointerEnd($event)" class="input-cover" tappable *ngIf="_useAssist"></div>',
directives: [
NextInput,
NativeInput
],
directives: [NativeInput, NextInput, NgIf],
encapsulation: ViewEncapsulation.None,
})
export class TextArea extends InputBase {