Username and password are automatically saved into browser local storage (or cookies depending) whether they want it to or not. This should be optional by adding a checkbox.
This tutorial help to create simple angular 4 application with localstorage.This application will use webstorage service plugin to store variable data into the browser, that can use HTML 5 local storage, Session storage or In-memory mechanism to store data.
You could have used "Please stop using local storage FOR SENSITIVE INFORMATION". besides that, its an amazing API which allows us developers to make cool things you couldnt do without ( at least not that easy ). Examples of localStorage uses I have used: Website theme changing