[Angular 2] 纯正的Angular 2 Date Picker
发布于 7 年前 作者 WuKongW 3330 次浏览 来自 分享

分享一下在平时项目写的一个简单的日期选择器📅的代码,希望对现在也在用Angular 2开发并且也需要📅组件的战友们有所帮助~~

为了避免各个项目中引入的样式库(Bootstrap…)不一样,所以源码中并没有使用外部样式库,只是简单的手写了一点样式,如果需要定制的,可以下载源码进行简单的更改。(^_^)

快速上手

  1. install
  npm install ng2-wk-date-picker --save-dev
  1. configure with resource loader and import into your project e.g. SystemJS
    System.config({
    map: {
        'ng2-wk-date-picker': 'node_modules/ng2-wk-date-picker'
    },
    packages: {
        'ng2-wk-date-picker': {
            main: 'index.js'
        }
    }
    });
 import { Ng2WkDatePickerModule } from 'ng2-wk-date-picker';
  @NgModule({
    imports: [
        BrowserModule,
        Ng2WkDatePickerModule
    ],
    declarations: [],
    bootstrap: [],
  })
  export class AppModule { }

GitHub地址https://github.com/WuKongW/Angular2-datepicker 码云地址http://git.oschina.net/wkong/Angular2-datepicker 简单的演示地址 屏幕快照 2017-01-12 下午10.34.13.png

回到顶部