[CORD-1043] Adding click handler to display models
Change-Id: I331a193afed8e3d4f1bc5699dcb4d91a7404fa07
diff --git a/src/app/core/services/helpers/component-injector.helpers.ts b/src/app/core/services/helpers/component-injector.helpers.ts
index 908e4c7..9fc475b 100644
--- a/src/app/core/services/helpers/component-injector.helpers.ts
+++ b/src/app/core/services/helpers/component-injector.helpers.ts
@@ -47,9 +47,6 @@
});
}
- // FIXME
- // component are correctly injected but not persisted,
- // if I change route they go away
public injectComponent(target: string | JQuery, componentName: string, attributes?: any, transclude?: string, clean?: boolean) {
let targetEl;
if (angular.isString(target)) {
@@ -74,7 +71,10 @@
if (angular.isDefined(attributes) && angular.isObject(attributes)) {
attr = this.stringifyAttributes(attributes);
- scope = angular.merge(scope, attributes);
+ // we cannot use angular.merge as it cast Resource to Objects
+ _.forEach(Object.keys(attributes), (k: string) => {
+ scope[k] = attributes[k];
+ });
}
const componentTag = `<${componentTagName} ${attr}>${transclude || ''}</${componentTagName}>`;