Skip to content

wiki - Docs Request: Explain how to add @angular2-material/toolbar including css #770

Description

@wzr1337

I was spending some time to figure out how to add <md-toolbar> from @angular2-material/toolbar to my app. I needed to manually add css links and adapt some files:

Added
'@angular2-material/toolbar': { format: 'cjs', defaultExtension: 'js', main: 'toolbar.js' },
=> obvious from the checkbox example in the wiki

Added
'@angular2-material/**/*.css'
to vendorNpmFiles, to let the build tools actually copy the css needed for proper display

Added

import { MdToolbar } from '@angular2-material/toolbar'; for my *.ts code

and

directives: [ MdToolbar, ]

to my @Component

and finally I had to manually add the css links to my index.html, because I was not sure how to let the build chain include the css through {{content-for 'head'}} - if that is even possible.

I am not too sure about my solution being the proper one, so please let me know what might be "out of style". Please let me also know if you want me to extend the wiki.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions