app/js/controllers/list.js
// we init the list and will be using this method later to refresh the list
we init the list and will be using this method later to refresh the list
we init the list and will be using this method later to refresh the list
function initList() {
		if (vars.data.length === 0) {
			ApiService.get(AppSettings.CARDS_JSON_MOCK).then(function(res) {
				AppService.updateData('data', res);
				$timeout(function() {
					AppService.updateData('doneLoading', true); 
				}, 1000);
			})
		} else {
			$timeout(function() {
				AppService.updateData('doneLoading', true); 
			}, 1000);
		}
	}
function initList ( ) { if ( vars . data . length === 0 ) { ApiService . get ( AppSettings . CARDS_JSON_MOCK ) . then ( function ( res ) { AppService . updateData ( 'data' , res ) ; $timeout ( function ( ) { AppService . updateData ( 'doneLoading' , true ) ; } , 1000 ) ; } ) } else { $timeout ( function ( ) { AppService . updateData ( 'doneLoading' , true ) ; } , 1000 ) ; } }
we init the list and will be using this method later to refresh the list
we init the list and will be using this method later to refresh the list
// so that the list does not reuse the constant // mock the request with a promise // mock a longer request // mock a longer request