Tarun
Tarun

Reputation: 2958

Does angular 2.0 alpha work with the components in angular/material Project?

I've been trying to get this to work, but haven't been able to. If it's possible, please point to a sample.

Upvotes: 18

Views: 12752

Answers (3)

Rob K
Rob K

Reputation: 324

I know this question is old, but I did discover today they have a link in the angular/material README that points to a repository they created specifically for the angular2 target of angular/material: https://github.com/angular/material2

It's still in alpha0.

As a suggestion, perhaps it might help to use something like http://www.getmdl.io/ until material2 gets off the ground. It might allow you to prototype sooner.

Upvotes: 1

urish
urish

Reputation: 9033

The team is working on a port of Angular Material for 2.0, and you can find the source code here.

I created a quick demo showing how to use it together with Angular 2:

import {Component, View, bootstrap} from 'angular2/angular2';
import {MdInput, MdInputContainer} from 'angular2_material/material';

// Defines a new HTML tag <hello-ngconf>
@Component({
    selector: 'material-demo'
})
@View({
    template: `
    <md-input-container>
      <label>Your name</label>
      <input #newname />
    </md-input-container>
    <p>
      Hello, {{newname.value}}
    </p>
    `,
    directives: [MdInputContainer, MdInput]
})
class MaterialDemoComponent {
}

bootstrap(MaterialDemoComponent);

See in action in this plunker.

You can find additional examples in the angular2 repo.

Be aware that this is still alpha code and it is not fully functional. For example, I couldn't get MdButton to work because of this issue.

Upvotes: 13

Zhorzh Alexandr
Zhorzh Alexandr

Reputation: 1469

Current version of angular-material will not work with angular 2.0, but i am sure there will be new branch(or version) which will be compatible with angualar 2.0.

Upvotes: 5

Related Questions