create.directive('renderInputs', [ function(){
return {
restrict: 'E',
scope: true,
templateUrl: function(elem, attrs) {
alert(attrs.type);
return '../templates/inputs/type-' + attrs.type + '.html';
}
}
}]);
<render-inputs type="{{ p.input.type }}"></render-inputs>
- Erro:
Error: [$compile:tpload] Failed to load template: ../templates/inputs/type-{{ p.input.type }}.html (HTTP status: 404 Not Found)
Estou com problemas em fazer em carregar um template dinâmicamente.
Meu alert
está retornando {{ p.input.type }}
, na realidade era pra retornar um tipo com esses valores: radio, checkbox, etc.
por exemplo: '../templates/inputs/type-radio.html'