Code coverage report for app/components/phone-form/phone-form.controller.js

Statements: 100% (36 / 36)      Branches: 100% (14 / 14)      Functions: 100% (9 / 9)      Lines: 100% (11 / 11)      Ignored: 2 statements, 4 branches     

All files » app/components/phone-form/ » phone-form.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 28                                   
class PhoneFormController {
    constructor () {
        this.allOS = ['Android', 'iOS', 'Windows Phone'];
    }
    submitForm (phone) {
        if (this.phoneForm.$invalid || !this.phone.releaseDate) {
            return;
        }
        this.isRequest = true;
        // call submit method passed in from outer scope
        this.submit({phone})
            .then(() => {
                this._endRequest();
                this.phoneForm.$setPristine();
            })
            .catch(this._endRequest.bind(this));
    }
 
    _endRequest () {
        this.isRequest = false;
    }
}
 
PhoneFormController.$inject = [];
 
export default PhoneFormController;