You can easily do this using the operator ||inside the tag ng-src:
Controller:
$scope.loading = "<some-pic.gif>";
View:
<a href="#/information">
<img ng-src='{{ (i.picture) || (loading) }}'/>
</a>
- Change the tag
srcto a ng-srcmore angular friendly - Define the uploaded image / gif (previous upload) and save it in a variable
$scope ||, undefined, (gif)
Fiddle: http://jsfiddle.net/xf3ezakc/
, $ionicLoading , , , .
$scope.show = function() {
$ionicLoading.show({
template: 'Loading...'
}).then(function(){
console.log("The loading indicator is now displayed");
});
};
$scope.hide = function(){
$ionicLoading.hide().then(function(){
console.log("The loading indicator is now hidden");
});
};
$scope.data = {};
$scope.show();
someDataCall().then(function(data) {
$scope.hide();
}).catch(error) {
$scope.hide();
});
, firebase , $firebaseArray $firebaseObject, $ionicLoading $loaded, , ( API AngularFire):
$scope.data.$loaded().then(function(data) {
$scope.hide();
}).catch(function(error) {
$scope.hide()
});
2 , $ionicLoading
:
ng-src
$ionicLoading
AngularFire
ion-spinner ( )