bb-inline-editor
Version:
Follow me [](https://twitter.com/carlillo) to be notified about new releases.
34 lines (28 loc) • 1.31 kB
text/typescript
import { Component, OnInit, Injector, ChangeDetectionStrategy } from "@angular/core";
import { InputBase } from "./input-base";
import { InlineTextConfig } from "../types/inline-configs";
export class InputPasswordComponent extends InputBase implements OnInit {
constructor(injector: Injector) {
super(injector);
this.isRegexTestable = true;
this.isLengthTestable = true;
}
public config: InlineTextConfig;
public showText(): string {
const isEmpty = this.state.isEmpty();
const value = String(this.state.getState().value);
return isEmpty ?
this.config.empty :
"*".repeat(value.length);
}
}