Changes between Version 11 and Version 12 of DeveloperGuidelines/EdenMobile/Database


Ignore:
Timestamp:
02/24/17 12:34:05 (8 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/EdenMobile/Database

    v11 v12  
    22[[TOC]]
    33
    4 == $emdb Service ==
     4== emResources Service ==
    55
    6 EdenMobile provides the '''$emdb''' service to access the database.
     6Access to user data is provided by the {{{emResources}}} service:
     7
     8To use the service, it must be included in the controller dependencies:
     9
     10{{{#!js
     11EdenMobile.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
     27EdenMobile provides the {{{emDB}}} service to access the database.
    728
    829To use the service, it must be included in the controller dependencies:
     
    1132#!js
    1233EdenMobile.controller("MyController", [
    13     '$scope', '$stateParams', '$emdb',
    14     function($scope, $stateParams, $emdb) {
     34    '$scope', '$stateParams', 'emDB',
     35    function($scope, $stateParams, emDB) {
    1536        // controller code goes here
    1637    }
     
    1839}}}
    1940
    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.
    2142
    2243== API ==