Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sonicoder86/dfa94bf513f8c453ad89f4eab73ba606 to your computer and use it in GitHub Desktop.
Save sonicoder86/dfa94bf513f8c453ad89f4eab73ba606 to your computer and use it in GitHub Desktop.
Component-Relative paths in Angular 2 for Webpack
import { Component } from '@angular/core';
import headerTemplate from './header.component.html';
import headerStyle from './header.component.css';
@Component({
selector: 'my-app',
template: headerTemplate,
styles: [headerStyle]
})
export class HeaderComponent implements OnInit {
}
@ThomasBurleson
Copy link

Thanks @BlackSonic - http://blog.thoughtram.io/angular/2016/06/08/component-relative-paths-in-angular-2.html

e.g. Thanks to Soós Gábor for his WebPack expertise and insight here.

@Hendrixer
Copy link

Typescript would complain if you tried to import anything other than ts right?

@Hendrixer
Copy link

That's why we're use require

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment