salix/client/core/src/lib/template.js

9 lines
384 B
JavaScript
Raw Normal View History

import {kebabToCamel} from './string';
template.$inject = ['$element', '$attrs', 'vnInputAttrsNormalizer', 'vnResolveDefaultComponent'];
export default function template($element, $attrs, normalizer, resolve) {
normalizer.normalize($attrs);
let templateName = kebabToCamel($element[0].tagName.toLowerCase().substr(3));
return resolve.getTemplate(templateName, $attrs);
}