There is one more thing that should be careful about this warning.
I got it, although I actually recited the component in my module, and it pushed me to the wall because everything looked right.
So, I went through compiler.umd.js, where a warning occurred, and I noticed that the component for which I was getting the error was added to the array of directives twice here:
if (force || !transitiveModule.directivesSet.has(dirMeta.type.runtime)) { transitiveModule.directivesSet.add(dirMeta.type.runtime); transitiveModule.directives.push(dirMeta); declaredDirectives.push(dirMeta); this._addTypeToModule(dirMeta.type.runtime, moduleType); return true; }
In principle, although the component was already in the Set directive, transitiveModule.directivesSet.has (dirMeta.type.runtime) evaluated false, so it was added again, and one of them raised a warning.
It turned out that the import statements in my routing file and my module file were slightly different. One headed the first letter of the directory in the path, while the other directory had everything lowercase:
//in routing import { SomeComponent } from './Directory/some.component'; //in app module import { SomeComponent } from './directory/some.component';
As soon as I changed so that the paths coincided, the warning disappeared. Everything else seemed to be functioning properly with an inappropriate housing.
doubletriplezero Aug 19 '16 at 12:59 on 2016-08-19 12:59
source share