aboutsummaryrefslogtreecommitdiffstats
path: root/3rd_party/static/testapi-ui/assets/lib/angular-ui-router/src/view.js
diff options
context:
space:
mode:
authorxudan <xudan16@huawei.com>2018-07-06 05:16:40 -0400
committerxudan <xudan16@huawei.com>2018-07-06 05:21:42 -0400
commitb3e40f026d655501bfa581452c447784604ecb05 (patch)
tree406f8bfc1abc1b33f98153d03abd34ef7b0e2fe9 /3rd_party/static/testapi-ui/assets/lib/angular-ui-router/src/view.js
parentb1b0ea32d1a296c7d055c5391261dcad6be48c63 (diff)
Move all web portal code to the new repo dovetail-webportal
This is only the first step to simply copy the file here. There still need some more work to make sure all work well. All the changes will be submitted with other patches to make it easily to review. JIRA: DOVETAIL-671 Change-Id: I64d32a9df562184166b6199e2719f298687d1a0a Signed-off-by: xudan <xudan16@huawei.com>
Diffstat (limited to '3rd_party/static/testapi-ui/assets/lib/angular-ui-router/src/view.js')
-rw-r--r--3rd_party/static/testapi-ui/assets/lib/angular-ui-router/src/view.js71
1 files changed, 71 insertions, 0 deletions
diff --git a/3rd_party/static/testapi-ui/assets/lib/angular-ui-router/src/view.js b/3rd_party/static/testapi-ui/assets/lib/angular-ui-router/src/view.js
new file mode 100644
index 0000000..f19a3c5
--- /dev/null
+++ b/3rd_party/static/testapi-ui/assets/lib/angular-ui-router/src/view.js
@@ -0,0 +1,71 @@
+
+$ViewProvider.$inject = [];
+function $ViewProvider() {
+
+ this.$get = $get;
+ /**
+ * @ngdoc object
+ * @name ui.router.state.$view
+ *
+ * @requires ui.router.util.$templateFactory
+ * @requires $rootScope
+ *
+ * @description
+ *
+ */
+ $get.$inject = ['$rootScope', '$templateFactory'];
+ function $get( $rootScope, $templateFactory) {
+ return {
+ // $view.load('full.viewName', { template: ..., controller: ..., resolve: ..., async: false, params: ... })
+ /**
+ * @ngdoc function
+ * @name ui.router.state.$view#load
+ * @methodOf ui.router.state.$view
+ *
+ * @description
+ *
+ * @param {string} name name
+ * @param {object} options option object.
+ */
+ load: function load(name, options) {
+ var result, defaults = {
+ template: null, controller: null, view: null, locals: null, notify: true, async: true, params: {}
+ };
+ options = extend(defaults, options);
+
+ if (options.view) {
+ result = $templateFactory.fromConfig(options.view, options.params, options.locals);
+ }
+ if (result && options.notify) {
+ /**
+ * @ngdoc event
+ * @name ui.router.state.$state#$viewContentLoading
+ * @eventOf ui.router.state.$view
+ * @eventType broadcast on root scope
+ * @description
+ *
+ * Fired once the view **begins loading**, *before* the DOM is rendered.
+ *
+ * @param {Object} event Event object.
+ * @param {Object} viewConfig The view config properties (template, controller, etc).
+ *
+ * @example
+ *
+ * <pre>
+ * $scope.$on('$viewContentLoading',
+ * function(event, viewConfig){
+ * // Access to all the view config properties.
+ * // and one special property 'targetView'
+ * // viewConfig.targetView
+ * });
+ * </pre>
+ */
+ $rootScope.$broadcast('$viewContentLoading', options);
+ }
+ return result;
+ }
+ };
+ }
+}
+
+angular.module('ui.router.state').provider('$view', $ViewProvider);