I am using a service in my angular
application to create uibModal
as follows
function modal(modalConfig){
var modalInstance = $uibModal.open({
animation: true,
template: require("../a/b/xyz.html"),
controller: modalConfig.controller,
size: modalConfig.size,
controllerAs: modalConfig.controllerAs,
bindToController : true,
resolve: modalConfig.resolveObj
});
}
Please note the line
template: require("../a/b/xyz.html"),
I want to use a variable in its place like this
template: require(modalConfig.templateUrl),
but when i use a variable in place of hard coded value webpack
gives me
Critical dependencies:
83:22-54 the request of a dependency is an expression
I am not able to resolve this error. What can be the possible reason for it?
I have used node-express
server for continuous webpack
builds. I have looked at other answers too but they didn't solve my query.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…