Skip to content

Instantly share code, notes, and snippets.

@asicfr
Created February 22, 2013 13:28
Show Gist options
  • Save asicfr/5013369 to your computer and use it in GitHub Desktop.
Save asicfr/5013369 to your computer and use it in GitHub Desktop.
Capacité HTML5 du navigateur
// Detect html5 compliance with Modernizr
$rootScope.localstorageEnable = Modernizr.localstorage;
$rootScope.offlineEnable = Modernizr.applicationcache;
$rootScope.logMe("localstorage : " + $rootScope.localstorageEnable);
$rootScope.logMe("offline : " + $rootScope.offlineEnable);
if (($rootScope.offlineEnable == false) || ($rootScope.localstorageEnable == false)) {
toastr.error("Your browser isn't applicationCache compliant !");
} else {
// localstorage conf and init
$rootScope.dataStoreKey = "dataStoreKey";
$rootScope.dataStore = {};
ApiStorage.init();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment