blob: 19b0d45d9c729b8402bdd3e2b90b1b66e2eedc4b (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <script type="text/javascript" src="../lib/underscore/underscore.js"></script>
    <script type="text/javascript" src="../lib/jquery/jquery-1.3.2.js"></script>
    <script type="text/javascript" src="../src/angular-bootstrap.js"></script>
    <script type="text/javascript">
      $(document).ready(function(){
        var scope = angular.compile(document);
        scope.init();
        scope.set("add", function(){
          var partial = $("#partial");
          //id++;
          partial.html('<div>{{ error() }}<br/></div>');
          var scope = angular.compile(partial);
          scope.set("hello", function (){
            return 'who dat?';
          });
          scope.set("error", function (){
            this.misko.length;
          });
          function XXXXXXXXX(){};
          scope.set('xxx', new XXXXXXXXX());
          scope.set("names", ["adam", "misko", "shyam"]);
          scope.init();
        });
        scope.set("remove", function(){
          var partial = $("#partial");
          /*
          partial.find('*').andSelf().each(function(){
            var scope = $(this).data('scope');
            if (scope) {
              delete scope.state;
              delete scope.widgets;
            }
            var cntl = $(this).data('controller');
            if (cntl) {
              delete cntl.view;
            }
            $(this).removeData();
          });
          */
          partial.removeData('scope');
          partial.children().remove();
        });
      });
    </script>
    <link rel="StyleSheet" type="text/css" href="../css/angular.css"/>
  </head>
  <body>
  <input type="button" value="add" ng:click="add()"/>
  <input type="button" value="remove" ng:click="remove()"/>
  <div id="partial"></div>
  </body>
</html>
 |