Changes between Version 11 and Version 12 of DeveloperGuidelines/EdenMobile/Database
- Timestamp:
- 02/24/17 12:34:05 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/EdenMobile/Database
v11 v12 2 2 [[TOC]] 3 3 4 == $emdbService ==4 == emResources Service == 5 5 6 EdenMobile provides the '''$emdb''' service to access the database. 6 Access to user data is provided by the {{{emResources}}} service: 7 8 To use the service, it must be included in the controller dependencies: 9 10 {{{#!js 11 EdenMobile.controller("MyController", [ 12 '$scope', '$stateParams', 'emResources', 13 function($scope, $stateParams, emResources) { 14 15 emResources.open(resourceName).then(function(resource) { 16 17 // Do something with the resource 18 }); 19 } 20 ]); 21 }}} 22 23 {{{emResources}}} uses the {{{emDB}}} service to access the database. 24 25 == emDB Service == 26 27 EdenMobile provides the {{{emDB}}} service to access the database. 7 28 8 29 To use the service, it must be included in the controller dependencies: … … 11 32 #!js 12 33 EdenMobile.controller("MyController", [ 13 '$scope', '$stateParams', ' $emdb',14 function($scope, $stateParams, $emdb) {34 '$scope', '$stateParams', 'emDB', 35 function($scope, $stateParams, emDB) { 15 36 // controller code goes here 16 37 } … … 18 39 }}} 19 40 20 {{{ $emdb}}} automatically creates the database and tables when it is initialized for the first time.41 {{{emDB}}} automatically creates the database and tables when it is initialized for the first time. 21 42 22 43 == API ==