As an Angular 4 + Material developer, I recently created a custom library that has been presenting me with numerous challenges. One component in particular, the SearchComponent, seemed pretty straightforward at first.
search.component.ts
@Component({
selector: 'cis-search',
templateUrl: './search.component.html',
styleUrls: ['./search.component.scss'],
encapsulation: ViewEncapsulation.None,
host: {
'class': 'search'
}})
export class CisSearchComponent implements OnChanges {}
module
@NgModule({
imports: [
CommonModule,
MdIconModule,
MdListModule,
BrowserAnimationsModule,
HttpModule
],
providers: [SearchService],
declarations: [CisSearchComponent],
exports: [CisSearchComponent]
})
export class CisSearchModule {}
After packaging this module using rollup, I encountered an issue in my main project:
{
provide: DOCUMENT, useValue: {value: document}
}
The error message displayed was:
TypeError: this._document.createElement is not a function
at MdCommonModule._checkTheme (material.es5.js:191)
at new MdCommonModul
I am currently facing this error and would appreciate any guidance on how to resolve it. All dependencies are installed and up to date.