support for angular-dashboard-framework apply method

This commit is contained in:
Sebastian Sdorra
2016-01-03 16:39:39 +01:00
parent f746582722
commit f6418dea2e
3 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -52,11 +52,12 @@ module.exports = {
// {resolve: ..}
res.push.apply(res, ctx.matchResolve(props));
// edit: {controller: function(), resolve: {}}
// edit: {controller: function(), resolve: {}, apply: function()}
const edit = ctx.matchProp('edit', props);
if (edit && edit.type === "ObjectExpression") {
const editProps = edit.properties;
res.push(ctx.matchProp('controller', editProps));
res.push(ctx.matchProp('apply', editProps));
res.push.apply(res, ctx.matchResolve(editProps));
}
@@ -83,6 +83,9 @@ angular.module('myMod', ['adf.provider'])
controller: ["$http", function($http){
// control something
}],
apply: ["$http", "config", function($http, config){
// apply configuration
}],
resolve: {
editone: ["$http", "config", function($http, config){
// resolve something
+3
View File
@@ -83,6 +83,9 @@ angular.module('myMod', ['adf.provider'])
controller: function($http){
// control something
},
apply: function($http, config){
// apply configuration
},
resolve: {
editone: function($http, config){
// resolve something