const app = require('../app') app.component('appLoginPage', { template: html`
Login Forgot password
`, controllerAs: 'login', controller: function(api, $mdToast, $location) { this.submit = async form => { try { const res = await api.login(this.model) api.setToken(res.token) $location.url('/dashboard') } catch (err) { $mdToast.showSimple(`Login failed`) } } } })