/
config-angular.coffee
57 lines (44 loc) · 1.27 KB
/
config-angular.coffee
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
module.exports = (config, options) ->
log = require "#{config.req.helpers}/log"
test = require("#{config.req.helpers}/test")()
# default modules
# ===============
modules = ['ngResource', 'ngRoute', 'ngSanitize']
# init angular
# ============
angular = {}
# modules
# =======
angular.modules = options.angular.modules or []
angular.modules = modules.concat angular.modules
# version
# =======
angular.version = options.angular.version or '1.x'
# module name
# ===========
angular.moduleName = options.angular.moduleName or 'app'
# template cache
# ==============
angular.templateCache = {}
angular.templateCache.dev = {}
angular.templateCache.dev.enable = options.angular.templateCache.dev.enable or false
angular.templateCache.useAbsolutePaths = options.angular.templateCache.useAbsolutePaths or false
# rb bower dependencies
# =====================
angular.bowerDeps =
'angular': angular.version
'angular-resource': angular.version
'angular-route': angular.version
'angular-sanitize': angular.version
# add angular to config
# =====================
config.angular = angular
# logs
# ====
# log.json angular, 'angular ='
# tests
# =====
test.log 'true', config.angular, 'add angular to config'
# return
# ======
config