2
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>
- Error:
Error: [$compile:tpload] Failed to load template: ../templates/inputs/type-{{ p.input.type }}.html (HTTP status: 404 Not Found)
I’m having trouble loading a template dynamically.
Man alert
is returning {{ p.input.type }}
, in reality was to return a type with these values: radio, checkbox, etc.
for example: '../templates/inputs/type-radio.html'