The main rule here is that:
The selectors which are applicable during compilation of a component template are determined by the module that declares that component, and the transitive closure of the exports of that module’s imports.
So, try to export it:
@NgModule({
declarations: [TaskCardComponent],
imports: [MdCardModule],
exports: [TaskCardComponent] // <== export the component you want to use in another module
})
export class TaskModule{}
What should I export?
Export declarable classes that components in other modules should be
able to reference in their templates. These are your public classes.
If you don’t export a class, it stays private, visible only to other
component declared in this module.
The minute you create a new module, lazy or not, any new module and you declare anything into it, that new module has a clean state(as Ward Bell said in https://devchat.tv/adv-in-angular/119-aia-avoiding-common-pitfalls-in-angular2)
Angular creates transitive module for each of @NgModules.
This module collects directives that either imported from another module(if transitive module of imported module has exported directives) or declared in current module.
When angular compiles template that belongs to module X it is used those directives that had been collected in X.transitiveModule.directives.
compiledTemplate = new CompiledTemplate(
false, compMeta.type, compMeta, ngModule, ngModule.transitiveModule.directives);
https://github.com/angular/angular/blob/4.2.x/packages/compiler/src/jit/compiler.ts#L250-L251

This way according to the picture above
-
YComponentcan’t useZComponentin its template becausedirectivesarray ofTransitive module Ydoesn’t containZComponentbecauseYModulehas not importedZModulewhose transitive module containsZComponentinexportedDirectivesarray. -
Within
XComponenttemplate we can useZComponentbecauseTransitive module Xhas directives array that containsZComponentbecause
XModuleimports module (YModule) that exports module (ZModule) that exports directiveZComponent -
Within
AppComponenttemplate we can’t useXComponentbecauseAppModuleimportsXModulebutXModuledoesn’t exportsXComponent.
See also
-
why lazy loaded module has to import commonModule? Angular 2
-
Angular Module FAQs
-
What is the difference between declarations, providers, and import in NgModule?