/
prefix.ts
30 lines (26 loc) · 903 Bytes
/
prefix.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/**
* @license
* Copyright Google LLC All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {Directive, InjectionToken, Input} from '@angular/core';
/**
* Injection token that can be used to reference instances of `MatPrefix`. It serves as
* alternative token to the actual `MatPrefix` class which could cause unnecessary
* retention of the class and its directive metadata.
*/
export const MAT_PREFIX = new InjectionToken<MatPrefix>('MatPrefix');
/** Prefix to be placed in front of the form field. */
@Directive({
selector: '[matPrefix], [matIconPrefix], [matTextPrefix]',
providers: [{provide: MAT_PREFIX, useExisting: MatPrefix}],
})
export class MatPrefix {
@Input('matTextPrefix')
set _isTextSelector(value: '') {
this._isText = true;
}
_isText = false;
}