Changes between Version 3 and Version 4 of DeveloperGuidelines/EdenMobile/Routing
- Timestamp:
- 03/30/17 12:16:07 (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DeveloperGuidelines/EdenMobile/Routing
v3 v4 41 41 == View and Controller == 42 42 43 The role of controllers and views is equivalent to controllers/views in the Sahana Eden web application. 43 The role of controllers and views is equivalent to controllers/views in the Sahana Eden web application. The view template is rendered, and the state controller executed, when the state is first entered (unless reloading is enforced in $state.go, then both would be reloaded). 44 44 45 The view template is rendered, and the state controller executed when the state is first entered (unless reloading is enforced in $state.go, then both would be reloaded). 45 View and controller in EdenMobile are connected through the AngularJS "model" (=a data object in memory similar to Sahana Eden's ''response''). Access to the "model" is provided by the {{{$scope}}} service, which is why we commonly refer to it as the '''Scope''' rather than the "Model" (also to avoid confusion with database table schemas which are called "models" in Sahana Eden). 46 46 47 Unlike Sahana Eden view templates, though, placeholders in EdenMobile views are updated whenever the corresponding {{{$scope}}} attribute changes, e.g. a template 47 Note, however, that the scope is not a singleton like ''response'': scopes are hierarchical, and usually upwards-transparent (although they can be fully isolated). 48 48 49 And unlike Sahana Eden ''responses'', placeholders in EdenMobile views are ''updated'' whenever the corresponding {{{$scope}}} attribute changes, e.g. a template like: 49 50 {{{#!xml 50 51 <!-- in the view: -->