Code coverage report for app/pages/dashboard/dashboard.controller.js

Statements: 100% (37 / 37)      Branches: 100% (10 / 10)      Functions: 100% (9 / 9)      Lines: 100% (12 / 12)      Ignored: 2 statements, 4 branches     

All files » app/pages/dashboard/ » dashboard.controller.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                               
class DashboardController {
    constructor (UserAPI) {
        Object.assign(this, {UserAPI});
 
        this.colors = ['indigo', 'red', 'pink'];
 
        const userInfo = this.UserAPI.getUserInfo();
        this.welcomeMessage = `Welcome ${userInfo.name}!`;
        this._getProductsSummary();
    }
 
    _getProductsSummary () {
        this.UserAPI.getProductSummary()
            .then((data) => {
                this.products = data;
                this.products.forEach((product) => {
                    product.link = `root.layout.${product.name}`;
                });
            });
    }
}
 
DashboardController.$inject = ['UserAPI'];
 
export default DashboardController;