I’m working in a custom UI for a project, with quite heavy customisations to the UI. One of the issues I’m getting is that the templateUrl of the directives are hardcoded, that means to change the templates in the GN code instead of doing that in the view.
Not an expert in Angular, so maybe there’s a way to override these templates?
Discussing with a colleague in my company, he indicated that a solution could be to replace templateUrl with this:
templateUrl: function ($element, $attrs) {
return $attrs.templateUrl || ‘some/path/default.html’
},
I tried with the gnMapField directive and works fine:
Is there any other simple method to accomplish this?
If not, sounds fine to replace the templateUrl in the directives as described previously? I can manage at least for the directives I need to update for this project.
And maybe should be something to consider also for future developments to follow this pattern for directives?
The template url could be a variable, could be an angular.value, or could be a function, as you did.
All ways are good, the value is maybe less intrusive.
If you change the code to make the template url configurable, commit it in GN for you not to diverge too much from trunk.
I’m working in a custom UI for a project, with quite heavy customisations to the UI. One of the issues I’m getting is that the templateUrl of the directives are hardcoded, that means to change the templates in the GN code instead of doing that in the view.
Not an expert in Angular, so maybe there’s a way to override these templates?
Discussing with a colleague in my company, he indicated that a solution could be to replace templateUrl with this:
templateUrl: function ($element, $attrs) {
return $attrs.templateUrl || ‘some/path/default.html’
},
I tried with the gnMapField directive and works fine:
Is there any other simple method to accomplish this?
If not, sounds fine to replace the templateUrl in the directives as described previously? I can manage at least for the directives I need to update for this project.
And maybe should be something to consider also for future developments to follow this pattern for directives?
Please consider the environment before printing this email.
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
The template url could be a variable, could be an angular.value, or could be a function, as you did.
All ways are good, the value is maybe less intrusive.
If you change the code to make the template url configurable, commit it in GN for you not to diverge too much from trunk.
I’m working in a custom UI for a project, with quite heavy customisations to the UI. One of the issues I’m getting is that the templateUrl of the directives are hardcoded, that means to change the templates in the GN code instead of doing that in the view.
Not an expert in Angular, so maybe there’s a way to override these templates?
Discussing with a colleague in my company, he indicated that a solution could be to replace templateUrl with this:
templateUrl: function ($element, $attrs) {
return $attrs.templateUrl || ‘some/path/default.html’
},
I tried with the gnMapField directive and works fine:
Is there any other simple method to accomplish this?
If not, sounds fine to replace the templateUrl in the directives as described previously? I can manage at least for the directives I need to update for this project.
And maybe should be something to consider also for future developments to follow this pattern for directives?
Please consider the environment before printing this email.
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! https://ad.doubleclick.net/ddm/clk/302982198;130105516;z