mirror of
https://github.com/wahyd4/Libr-mobile.git
synced 2026-08-09 12:55:56 +10:00
29 lines
541 B
CoffeeScript
29 lines
541 B
CoffeeScript
libr = angular.module 'libr.services.utils', []
|
|
|
|
class IonicUtils
|
|
|
|
@$inject: ['$timeout']
|
|
constructor: (@$timeout)->
|
|
|
|
initCustomLoading: (scope)->
|
|
scope.data = {
|
|
isLoading: false
|
|
text: null
|
|
}
|
|
|
|
showLoading: (scope, text, timing = 3000)->
|
|
scope.data = {
|
|
isLoading: true
|
|
text: text
|
|
}
|
|
@$timeout ()=>
|
|
@initCustomLoading(scope)
|
|
, timing
|
|
|
|
cacheImage: (imageUrl)->
|
|
unless ImgCache.isCached(imageUrl)
|
|
ImgCache.cacheFile(imageUrl, null)
|
|
|
|
|
|
|
|
libr.service 'IonicUtils', IonicUtils |