JSONP request to server example
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 31 Oct 2010 13:36:31 +0000 (14:36 +0100)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 31 Oct 2010 13:36:31 +0000 (14:36 +0100)
templates/Cookbook/9-connector.html.ep [new file with mode: 0644]

diff --git a/templates/Cookbook/9-connector.html.ep b/templates/Cookbook/9-connector.html.ep
new file mode 100644 (file)
index 0000000..7d58b35
--- /dev/null
@@ -0,0 +1,27 @@
+<script type="text/javascript"> 
+       TestCntl.$inject = ['$xhr', '$route']; 
+
+       function TestCntl(xhr, route){ 
+
+               this.route = route; 
+               this.xhr = xhr; 
+
+               var data = {}
+               this.data = data;
+
+               this.xhr("JSON"
+                       , "/data/Cookbook/test/?callback=JSON_CALLBACK"
+                       , function(code, response){ 
+                               console.log(code, response, data);
+                               data.response = response;
+                       }
+               ); 
+
+       } 
+</script> 
+
+<div ng:controller="TestCntl"> 
+<pre>
+data={{data}}
+</pre>
+</div>