I\'ve been reading some articles about Angular 2 pitfalls and what to avoid, one of those things revolves around not accessing the DOM directly.
I noticed that the
I don't like accessing the dom in Angular but this use case you may need to. The only way to disable the annoying auto complete seems to be to add the attribute "readonly" and remove it after the form loads.
ngAfterViewInit() {
window.setTimeout(function () {
var arr: HTMLCollection = document.getElementsByClassName('form-control');
for (var i = 0; i < arr.length; i++) {
if (arr[i].hasAttribute("readonly")) {
arr[i].removeAttribute('readonly');
}
}
}, 500);
}