'use strict'; angular .module('app') .component('signin', { templateUrl: '/resources/signin/signin.component.html', controller: ['$scope', '$location', 'cms', function ($scope, $location, cms) { Object.assign($scope, { login: user => { cms.Authenticate({ grant_type: 'password', client_id: 'cms', username: user.username, password: user.password, }).then( auth => { $location.path('/a/dashboard') }, error => { console.log('auth-error', error) }) }, user: { password: 123456789, username: 'portal@portal', } }) }] });