28 lines
766 B
JavaScript
28 lines
766 B
JavaScript
/**
|
|
* Created by tsufiev on 12/29/14.
|
|
*/
|
|
|
|
(function() {
|
|
angular.module('hz')
|
|
|
|
.factory('defaultSetter', function($parse) {
|
|
return function(attrs, attrName, defaultValue) {
|
|
if ( attrs[attrName] === undefined ) {
|
|
attrs[attrName] = defaultValue;
|
|
} else {
|
|
attrs[attrName] = $parse(attrs[attrName])();
|
|
}
|
|
}
|
|
})
|
|
|
|
.run(function($http, $templateCache) {
|
|
var fields = ['dictionary', 'frozendict', 'list', 'string', 'varlist'];
|
|
fields.forEach(function(field) {
|
|
var base = '/static/mistral/js/angular-templates/fields/';
|
|
$http.get(base + field + '.html').success(function(templateContent) {
|
|
$templateCache.put(field, templateContent);
|
|
});
|
|
})
|
|
})
|
|
|
|
})(); |