diff --git a/work/test1/app.js b/work/test1/app.js new file mode 100644 index 000000000000..e6b28906ff17 --- /dev/null +++ b/work/test1/app.js @@ -0,0 +1,25 @@ +function Controller($scope, $element, $compile) { + console.log('init controller'); + var count = 0; + $scope.age = 21; + $scope.setName = function() { + $scope.name = "angular " + ++count; + } + $scope.addInterpolation = function() { + var p = document.createElement('p'); + p.setAttribute('id', 'p2'); + var t = document.createTextNode('a new node "{{name}}" inserted'); + p.appendChild(t); + $element[0].appendChild(p); + } + $scope.changeNode = function() { + var p = document.getElementById('p'); + var t = document.createTextNode('node changed "{{name}}"'); + p.appendChild(t); + } + $scope.compile = function() { + //$compile(document.getElementById('p'))($scope); + //$compile(document.getElementById('p2'))($scope); + $compile($element[0])($scope); + } +} diff --git a/work/test1/index.html b/work/test1/index.html new file mode 100644 index 000000000000..814039290d2b --- /dev/null +++ b/work/test1/index.html @@ -0,0 +1,21 @@ + + + + Codestin Search App + + + +
+

Hello {{name}} !!!

+ + + + +
+ + + + + + + \ No newline at end of file