1 (function(angular
, CRM
) {
2 var crmApp
= angular
.module('crmApp', CRM
.angular
.modules
);
3 crmApp
.config(['$routeProvider',
4 function($routeProvider
) {
5 $routeProvider
.otherwise({
6 template
: ts('Unknown path')
10 crmApp
.factory('crmApi', function() {
11 return function(entity
, action
, params
, message
) {
12 // JSON serialization in CRM.api3 is not aware of Angular metadata like $$hash
13 if (CRM
._
.isObject(entity
)) {
14 return CRM
.api3(eval('('+angular
.toJson(entity
)+')'), message
);
16 return CRM
.api3(entity
, action
, eval('('+angular
.toJson(params
)+')'), message
);
20 crmApp
.factory('crmLegacy', function() {
23 crmApp
.factory('crmNavigator', ['$window', function($window
) {
25 redirect: function(path
) {
26 $window
.location
.href
= path
;