Angular loading template manualy and then concatenate with another one

46 Views Asked by At

I need to load some template from path and concatenate with another one example:

 (function (module) {
    var modalDialog = function (modal) {
        return function (item, template, header) {//template as parameter
            var inlineTMp = "<div>inline template</div>";//this template
            var concatTemplate = template + inlineTMp;//pseudo code
            var modalInstance;
            var options = {
                template: concatTemplate,
                controller: function () {
                    this.title = header || 'Dialog';
                    this.data = angular.copy(item);
                    this.noClicked = function() {
                        modalInstance.dismiss('cancel');
                    };
                    this.yesClicked = function (itemData) {
                        modalInstance.close(itemData);
                    };
                },
                controllerAs:"model"
            };

            modalInstance = modal.open(options);
            return modalInstance.result;
        }
    }
    module.factory("modalDialog", ['$modal', modalDialog]);
})(angular.module("common"));

so how do i download a template then concatenate with another and send to service.

0

There are 0 best solutions below