angular - typescript ang2 include from location a or b depending on existence of file -


i have simple app.module.ts file includes component (among other things) in usual fashion:

import {topiclistcomponent} "./core/components/topic/topic-list.component"; 

this blindly attempt include ./core/components/topic/topic-list.component.. able like:

import {topiclistcomponent} "./override/components/topic/topic-list.component" || "./core/components/topic/topic-list.component"; 

currently have simple gulp system copies core files folder, copies override files (if any) same location th title suggests overrides core files.

but, possible manage in code opposed in build process open door more complex template/component override systems... maybe custom import function automatically checks override first , if not present imports core/


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -