Commit | Line | Data |
---|---|---|
e7ff7042 TO |
1 | {literal} |
2 | <div ng-app="crmApp"> | |
3 | <div ng-view></div> | |
4 | </div> | |
5 | ||
6 | <script type="text/javascript"> | |
7 | (function() { | |
8 | var crmApp = angular.module('crmApp', CRM.angular.modules); | |
9 | crmApp.config(['$routeProvider', | |
10 | function($routeProvider) { | |
11 | $routeProvider.otherwise({ | |
12 | template: ts('Unknown path') | |
13 | }); | |
14 | } | |
15 | ]); | |
3bd95007 TO |
16 | crmApp.factory('crmApi', function(){ |
17 | return function(entity, action, params, message) { | |
18 | // JSON serialization in CRM.api3 is not aware of Angular metadata like $$hash | |
19 | return CRM.api3(entity, action, eval('('+angular.toJson(params)+')'), message); | |
20 | }; | |
21 | }); | |
e7ff7042 TO |
22 | })(); |
23 | </script> | |
24 | ||
25 | {/literal} |