From 0dedd7fb2de76a6728162ff697f375251ddb08fd Mon Sep 17 00:00:00 2001 From: Kevin Giszewski Date: Wed, 25 Jun 2014 10:28:30 -0400 Subject: [PATCH] Fix for #160 --- app/directives/archetypecustomview.js | 17 ++--------------- app/views/archetype.default.html | 2 +- app/views/archetype.html | 2 +- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/app/directives/archetypecustomview.js b/app/directives/archetypecustomview.js index d6636bd..eb1da7c 100644 --- a/app/directives/archetypecustomview.js +++ b/app/directives/archetypecustomview.js @@ -1,23 +1,13 @@ angular.module("umbraco.directives").directive('archetypeCustomView', function ($compile, $http) { var linker = function (scope, element, attrs) { - var config = scope.archetype.config.archetypeConfig; - var view = "/App_plugins/Archetype/views/archetype.default.html"; - if(config.customViewPath) { + if(scope.model.config.customViewPath) { view = config.customViewPath; } $http.get(view).then(function(data) { - scope.model = {}; - scope.model.value = scope.archetype.value; - scope.model.config = scope.archetype.config; - - scope.$watch('model.value', function (newValue, oldValue) { - scope.archetype.value = newValue; - }); - element.html(data.data).show(); $compile(element.contents())(scope); @@ -27,9 +17,6 @@ angular.module("umbraco.directives").directive('archetypeCustomView', function ( return { restrict: "A", replace: true, - link: linker, - scope: { - archetype: "=" - } + link: linker } }); \ No newline at end of file diff --git a/app/views/archetype.default.html b/app/views/archetype.default.html index 328c300..52a4c3d 100644 --- a/app/views/archetype.default.html +++ b/app/views/archetype.default.html @@ -1,4 +1,4 @@ -
+
  • diff --git a/app/views/archetype.html b/app/views/archetype.html index 741c5f5..63b1114 100644 --- a/app/views/archetype.html +++ b/app/views/archetype.html @@ -1 +1 @@ -
    +