Code Monkey home page Code Monkey logo

ng2-mdl's Introduction

ng2-mdl

An Angular 2+ component library for Material Design Lite.

Installation

npm install --save ng2-mdl

What is Material Design Lite

Material Design Lite is a small component library for web project that follows google's material design pattern.

Why do I need a wrapper for this?

Material Design Lite is basically developed for vanilla JavaScript based uses. It's not well supported for framework like AngularJS and the next generation version of AngularJS which is know as Angular 2

Ok! But I need a wrapper for Angular 1.x.

That's already available here. Angular 2 version of the wrapper is basically base on this angular 1.x version. So, special thanks to Jad Joubran.

Documentation

Introduction
Upgrading
Text Fields
Select
Check Box
Radio Button
Switch
Button
Progress
Spinner
Layout

Want to Contribute?

Any contribution like a new component, bug fixes etc is cordially welcome. :)

ng2-mdl's People

Contributors

greenkeeperio-bot avatar sabbirrahman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ng2-mdl's Issues

ng2-mdl and angular-cli

Since it's (angluar-cli) now the most used way to start an angular2 project, it would be nice to add some guidelines on how to add it to the project that way. Do you know how to add it to an angular-cli project?

Select value does not update until manually changing value

I've noticed when using select, that the value does not update to the correct value until you manually update it... so if you get response from the server for example, it will just show the first slot even if a different value was selected. Any ideas on how to fix/update this properly?

Bundled issues

Hey, when I try to bundle my app like this

"buildng": "npm run tsc && npm run browserify",
"tsc": "tsc -p .",
"browserify": "browserify -s main  wwwroot/js/main.js > wwwroot/js/bundle.js"

and I have it setup as instructed in my app.module (import, imports) and trying to use the progress deal... I am getting this error before the app even starts:

Uncaught Error: Unexpected value 'Ng2MdlModule' imported by the module 'AppModule'
at https://localhost:44385/js/bundle.js:17111:37
at Array.forEach (native)
at CompileMetadataResolver.getNgModuleMetadata (https://localhost:44385/js/bundle.js:17096:46)
at RuntimeCompiler._compileComponents (https://localhost:44385/js/bundle.js:19817:49)
at RuntimeCompiler.compileModuleAndComponents (https://localhost:44385/js/bundle.js:19755:39)
at RuntimeCompiler.compileModuleAsync (https://localhost:44385/js/bundle.js:19746:23)
at PlatformRef
.bootstrapModuleWithZone (https://localhost:44385/js/bundle.js:27598:29)
at PlatformRef
.bootstrapModule (https://localhost:44385/js/bundle.js:27580:25)
at Object.374../app.module (https://localhost:44385/js/bundle.js:83232:53)
at s (https://localhost:44385/js/bundle.js:1:618)

Alias mdlUpgrade directive as mdl

Can we alias mdlUpgrade directive selector as mdl?

It seems to be semantically correct decision to me, and it looks like I'm not the only one. upgrade suffix is just redundant here and makes the layout less expressive (if this is even possible, considering the verbosity of MDL).

By the way, have you got any road map/task list? I intend to stick to this Material implementation for some projects and would happily collaborate on the repo.

Error on project setup

Hi,

Hi,
I have created a new project using ng2-mdl with gulp.

I got the following error while loading

platform-browser.umd.js:1900 STACKTRACE:BrowserDomAdapter.logError @ platform-browser.umd.js:1900ExceptionHandler.call @ core.umd.js:4331(anonymous function) @ core.umd.js:9849ZoneDelegate.invoke @ zone.js:323onInvoke @ core.umd.js:9100ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216NgZoneImpl.runInner @ core.umd.js:9131NgZone.run @ core.umd.js:9360ApplicationRef_.run @ core.umd.js:9838ApplicationRef_.bootstrap @ core.umd.js:9860(anonymous function) @ core.umd.js:9646ZoneDelegate.invoke @ zone.js:323onInvoke @ core.umd.js:9100ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356onInvokeTask @ core.umd.js:9091ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426 platform-browser.umd.js:1900 ReferenceError: componentHandler is not defined at MdlDirective.ngOnInit (mdl.directive.ts:10) at DebugAppView._View_HomeComponent0.detectChangesInternal (HomeComponent.template.js:127) at DebugAppView.AppView.detectChanges (core.umd.js:12143) at DebugAppView.detectChanges (core.umd.js:12247) at DebugAppView.AppView.detectViewChildrenChanges (core.umd.js:12169) at DebugAppView.AppView.detectChangesInternal (core.umd.js:12154) at DebugAppView.AppView.detectChanges (core.umd.js:12143) at DebugAppView.detectChanges (core.umd.js:12247) at ViewRef_.detectChanges (core.umd.js:10397) at eval (core.umd.js:9911)

Please help me on this.

It will be great if you create a seed project using ng2-mdl

Thanks,
Ananda

Text vertical centering

The text is not vertically being centered in a button, for example:

<mdlButton color="primary"><i class="material-icons">add</i> Add New</mdlButton>

ReferenceError: componentHandler is not defined

Hi sabbirrahman,

I'm having issues trying to insert a simple ng2-mdl component and I don't know if I'm missing steps or there is something wrong in the code:

With nodejs v6.5.0 and npm 3.10.3:

map: {
      .....
      'ng2-mdl': 'npm:ng2-mdl',
      .....
}

packages: {
      .......
      'ng2-mdl': {
          main: './index.js'
      },
      .......
}

Otherwise, when loading the app, I get the following error:

Error: XHR error (404 Not Found) loading http://localhost:3000/ng2-mdl(โ€ฆ)

  • npm start
  • When loading the page, the browser apparently gets correctly the files, but fails loading:
ReferenceError: componentHandler is not defined
    at MdlDirective.ngOnInit (mdl.directive.ts:10)
    at DebugAppView._View_MdlTextFieldComponent0.detectChangesInternal (MdlTextFieldComponent.ngfactory.js:90)
    at DebugAppView.AppView.detectChanges (core.umd.js:12061)
    at DebugAppView.detectChanges (core.umd.js:12166)
    at DebugAppView.AppView.detectViewChildrenChanges (core.umd.js:12087)
    at DebugAppView._View_AppComponent0.detectChangesInternal (AppComponent.ngfactory.js:116)
    at DebugAppView.AppView.detectChanges (core.umd.js:12061)
    at DebugAppView.detectChanges (core.umd.js:12166)
    at DebugAppView.AppView.detectViewChildrenChanges (core.umd.js:12087)
    at DebugAppView.AppView.detectChangesInternal (core.umd.js:12072)

I've also tried the angular2-webpack-starter with equal results.

Thanks in advance for your help,

JPV

ng2-mdl and angular-cli (webpack version)

I am trying to use ng2-mdl in the new webpack version of angular-cli, but I'm running into some issues. When I import and then try to add the Ng2MdlModule to my module's imports, I get the error Uncaught Error: Unexpected value 'Ng2MdlModule' imported by the module 'AppModule'. I saw issue #3 but since they changed from SystemJS to webpack, I don't think it's necessary to do anything special to get the app to find the .js files and as far as I know you should just need to run npm install --save ng2-mdl and it should be available for import. Any help or advice would be appreciated.

Form model doesn't get updated on browser autocomplete

When I'm using md-input and the browser does auto-complete on the form, the [(ngModel)] (in Angular2) doesn't get change event. So to workaround it I have to type/delete a symbol in the field.
Replacing the md-input to standard input type="text" solves the problem. Hence I believe it's a bug in md-input.

Can't compile in vscode and angular2 rc6 Quickstart

Hi, I am trying to run in the angular2 rc6 quickstart from vscode but I am getting the following typescript compiler errors

node_modules/ng2-mdl/src/mdl-check-box.component.ts(44,10): error TS7006: Parameter 'checked' implicitly has an 'any' type.
node_modules/ng2-mdl/src/mdl-check-box.component.ts(51,15): error TS7006: Parameter '' implicitly has an 'any' type.
node_modules/ng2-mdl/src/mdl-radio.component.ts(46,10): error TS7006: Parameter 'value' implicitly has an 'any' type.
node_modules/ng2-mdl/src/mdl-radio.component.ts(53,15): error TS7006: Parameter '
' implicitly has an 'any' type.
node_modules/ng2-mdl/src/mdl-select.component.ts(54,10): error TS7006: Parameter 'value' implicitly has an 'any' type.
node_modules/ng2-mdl/src/mdl-select.component.ts(79,15): error TS7006: Parameter '' implicitly has an 'any' type.
node_modules/ng2-mdl/src/mdl-switch.component.ts(43,10): error TS7006: Parameter 'checked' implicitly has an 'any' type.
node_modules/ng2-mdl/src/mdl-switch.component.ts(50,15): error TS7006: Parameter '
' implicitly has an 'any' type.
node_modules/ng2-mdl/src/mdl-text-field.component.ts(48,10): error TS7006: Parameter 'value' implicitly has an 'any' type.
node_modules/ng2-mdl/src/mdl-text-field.component.ts(55,15): error TS7006: Parameter '_' implicitly has an 'any' type.

I have typescript ^2.0.0 installed, any thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.