/
suffix.ts
30 lines (26 loc) · 905 Bytes
/
suffix.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 `MatSuffix`. It serves as
* alternative token to the actual `MatSuffix` class which could cause unnecessary
* retention of the class and its directive metadata.
*/
export const MAT_SUFFIX = new InjectionToken<MatSuffix>('MatSuffix');
/** Suffix to be placed at the end of the form field. */
@Directive({
selector: '[matSuffix], [matIconSuffix], [matTextSuffix]',
providers: [{provide: MAT_SUFFIX, useExisting: MatSuffix}],
})
export class MatSuffix {
@Input('matTextSuffix')
set _isTextSelector(value: '') {
this._isText = true;
}
_isText = false;
}