mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
updates
This commit is contained in:
@@ -64,7 +64,7 @@ export class AuthService {
|
||||
const data = SessionStore.getDataFromLocalStorage();
|
||||
|
||||
if (!data?.user?.Authorization && SessionStore?.user?.Authorization) {
|
||||
// window.location.reload();
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
if (window['all-process-gabinete']) {
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import { InputFilterDirective } from './input-filter.directive';
|
||||
|
||||
describe('InputFilterDirective', () => {
|
||||
it('should create an instance', () => {
|
||||
const directive = new InputFilterDirective();
|
||||
expect(directive).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,31 @@
|
||||
import { Directive, ElementRef, HostListener, Input, SecurityContext } from '@angular/core';
|
||||
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||
|
||||
@Directive({
|
||||
selector: '[appInputFilter]'
|
||||
})
|
||||
export class InputFilterDirective {
|
||||
|
||||
@Input() isAlphaNumeric: boolean;
|
||||
|
||||
constructor(private el: ElementRef, private sanitizer: DomSanitizer) {}
|
||||
|
||||
removeTags(inputValue) {
|
||||
const div = document.createElement("div");
|
||||
div.innerHTML = inputValue;
|
||||
var text = div.textContent || div.innerText || "";
|
||||
|
||||
return text
|
||||
}
|
||||
filter(inputValue) {
|
||||
|
||||
this.el.nativeElement.value = this.removeTags(inputValue)
|
||||
}
|
||||
|
||||
@HostListener('keypress', ['$event']) onInput(event: any): void {
|
||||
const inputValue: string = event.target.value;
|
||||
// Notify the subject when the input changes
|
||||
this.filter(inputValue);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user