forked from camptocamp/demo_geomapfish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
templatecache.mako.js
42 lines (39 loc) · 1.17 KB
/
templatecache.mako.js
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
## -*- coding: utf-8 -*-
<%doc>
This is a Mako template that generates Angular code putting the contents of
HTML partials into Angular's $templateCache. The generated code is then built
with the rest of JavaScript code. The generated script is not used at all in
development mode, where HTML partials are loaded through Ajax.
</%doc>
<%
import re
import os
import htmlmin
_partials = {}
for partial in partials.split():
f = file(partial)
content = unicode(f.read().decode('utf8'))
content = htmlmin.minify(content, remove_comments=True)
content = re.sub(r"'", "\\'", content)
dirname, filename = os.path.split(partial)
subdirname = os.path.basename(dirname.rstrip(os.sep))
_partials[os.path.join(subdirname, filename)] = content
%>\
/**
* @fileoverview Directive templates cache.
*
* GENERATED FILE. DO NOT EDIT.
*/
goog.require('demo');
(function() {
/**
* @param {angular.$cacheFactory.Cache} $templateCache
* @ngInject
*/
var runner = function($templateCache) {
% for partial in _partials:
$templateCache.put('${partial}', '${_partials[partial]}');
%endfor
};
demo.module.run(runner);
})();\