diff --git a/example/templates/bundle.json b/example/templates/bundle.json new file mode 100644 index 0000000000..38989c408c --- /dev/null +++ b/example/templates/bundle.json @@ -0,0 +1,17 @@ +{ + "extensions": { + "routes": [ + { + "when": "/templates", + "templateUrl": "templates.html" + } + ], + "controllers": [ + { + "implementation": "TemplateTestingController.js", + "key": "TTC", + "depends": [ "$scope", "objectService" ] + } + ] + } +} diff --git a/example/templates/res/templates.html b/example/templates/res/templates.html new file mode 100644 index 0000000000..ac2747acaa --- /dev/null +++ b/example/templates/res/templates.html @@ -0,0 +1,14 @@ +
+
+
mct-include
+ + +
+ +
+
mct-representation
+ + + +
+
diff --git a/example/templates/src/TemplateTestingController.js b/example/templates/src/TemplateTestingController.js new file mode 100644 index 0000000000..ccb4223603 --- /dev/null +++ b/example/templates/src/TemplateTestingController.js @@ -0,0 +1,18 @@ +/*global define*/ +define([], function () { + 'use strict'; + + return function TemplateTestingController($scope, objectService) { + $scope.ikey = ''; + $scope.rkey = ''; + $scope.rid = ''; + $scope.obj = undefined; + + $scope.$watch('rid', function (id) { + $scope.obj = undefined; + objectService.getObjects([id]).then(function (objs) { + $scope.obj = objs[id]; + }); + }); + }; +});