Jak utworzyć dyrektywę z dynamicznym szablonem w AngularJS?

Jak mogę utworzyć dyrektywę z dynamicznym szablonem?

'use strict';

app.directive('ngFormField', function($compile) {
return {
    transclude: true,
    scope: {
        label: '@'
    },
    template: '<label for="user_email">{{label}}</label>',
    // append
    replace: true,
    // attribute restriction
    restrict: 'E',
    // linking method
    link: function($scope, element, attrs) {
        switch (attrs['type']) {
            case "text":
                // append input field to "template"
            case "select":
                // append select dropdown to "template"
        }
    }
  }
});
<ng-form-field label="First Name" type="text"></ng-form-field>

Właśnie to mam teraz i wyświetla etykietę poprawnie. Nie wiem jednak, jak dodać dodatkowy HTML do szablonu. Lub łączenie 2 szablonów w 1.

questionAnswers(7)

yourAnswerToTheQuestion