fix angular.service $inject with $creation
[angular-mojolicious.git] / templates / Cookbook / 9-connector.html.ep
1 <script type="text/javascript"> 
2         TestCntl.$inject = ['$xhr', '$route']; 
3
4         function TestCntl(xhr, route){ 
5
6                 this.route = route; 
7                 this.xhr = xhr; 
8
9                 var data = {}
10                 this.data = data;
11
12                 this.xhr("JSON"
13                         , "/data/Cookbook/test/?callback=JSON_CALLBACK"
14                         , function(code, response){ 
15                                 console.log(code, response, data);
16                                 data.response = response;
17                         }
18                 ); 
19
20         } 
21 </script> 
22
23 <div ng:controller="TestCntl"> 
24 <pre>
25 data={{data}}
26 </pre>
27 </div>