summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/directives/inputs-and-properties/properties/property-row-directive.ts
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/directives/inputs-and-properties/properties/property-row-directive.ts')
-rw-r--r--catalog-ui/src/app/directives/inputs-and-properties/properties/property-row-directive.ts42
1 files changed, 42 insertions, 0 deletions
diff --git a/catalog-ui/src/app/directives/inputs-and-properties/properties/property-row-directive.ts b/catalog-ui/src/app/directives/inputs-and-properties/properties/property-row-directive.ts
new file mode 100644
index 0000000000..a9ff71cda5
--- /dev/null
+++ b/catalog-ui/src/app/directives/inputs-and-properties/properties/property-row-directive.ts
@@ -0,0 +1,42 @@
+/**
+ * Created by obarda on 1/8/2017.
+ */
+'use strict';
+
+export interface IPropertyRowDirective extends ng.IScope {
+ onNameClicked:Function;
+ isClickable:boolean;
+}
+
+export class PropertyRowDirective implements ng.IDirective {
+
+ constructor() {
+
+ }
+
+ scope = {
+ property: '=',
+ instanceName: '=',
+ instanceId: '=',
+ instancePropertiesMap: '=',
+ onNameClicked: '&',
+ onCheckboxClicked: '&'
+ };
+
+ restrict = 'E';
+ replace = true;
+ template = ():string => {
+ return require('./property-row-view.html');
+ };
+
+ link = (scope:IPropertyRowDirective, element:any, $attr:any) => {
+ scope.isClickable = $attr.onNameClicked ? true : false;
+ };
+
+ public static factory = ()=> {
+ return new PropertyRowDirective();
+ };
+
+}
+
+PropertyRowDirective.factory.$inject = [];