Understanding JavaScript Promises in Angular Controller and factory

Understanding JavaScript Promises in Angular Controller and factory