Update JSON API
[src/app-framework-demo.git] / afm-client / bower_components / angular-ui-router / src / view.js
1
2 $ViewProvider.$inject = [];
3 function $ViewProvider() {
4
5   this.$get = $get;
6   /**
7    * @ngdoc object
8    * @name ui.router.state.$view
9    *
10    * @requires ui.router.util.$templateFactory
11    * @requires $rootScope
12    *
13    * @description
14    *
15    */
16   $get.$inject = ['$rootScope', '$templateFactory'];
17   function $get(   $rootScope,   $templateFactory) {
18     return {
19       // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })
20       /**
21        * @ngdoc function
22        * @name ui.router.state.$view#load
23        * @methodOf ui.router.state.$view
24        *
25        * @description
26        *
27        * @param {string} name name
28        * @param {object} options option object.
29        */
30       load: function load(name, options) {
31         var result, defaults = {
32           template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}
33         };
34         options = extend(defaults, options);
35
36         if (options.view) {
37           result = $templateFactory.fromConfig(options.view, options.params, options.locals);
38         }
39         return result;
40       }
41     };
42   }
43 }
44
45 angular.module('ui.router.state').provider('$view', $ViewProvider);