Giter VIP home page Giter VIP logo

Comments (13)

armno avatar armno commented on July 17, 2024 2

maybe a bit too late but here is how I put this module with angular-cli

  • angular-cli 1.0.0-beta.14
  • angular 2.0.0
  • ng2-datepicker 1.0.6
$ npm install ng2-datepicker

in app.module.ts

// import datepicker component
import { DatePicker } from 'ng2-datepicker/ng2-datepicker';

// the put the component in `declarations` option
@NgModule({
  declarations: [
    AppComponent,
    DatePicker,
    ...
  ]
})

that's it. <datepicker> is available to the app. hope it helps.

from ng2-datepicker.

jkuri avatar jkuri commented on July 17, 2024 1

but yes, upgrading your app won't do any harm as RC6 is definitely more like the final release then the one you have now.

from ng2-datepicker.

jkuri avatar jkuri commented on July 17, 2024

Hi @igisav, if you use newer versions of angular-cli (which is recommended) you just import
import {DatePicker} from 'ng2-datepicker'; in app.module.ts and it will be bundled within your app.

from ng2-datepicker.

igisav avatar igisav commented on July 17, 2024

That is a problem - we use old version 1.0.0-beta.10. The update of new with webpack is a nightmare.

from ng2-datepicker.

jkuri avatar jkuri commented on July 17, 2024

You can still configure SystemJS configuration mappings to ng2-datepicker.js, the module comes with compiled files. Then instead of importing {DatePicker} into NgModule add it to directives: [...] in component where you are using it.

from ng2-datepicker.

igisav avatar igisav commented on July 17, 2024

The module comes NOT with compiled files. if I do npm install or ng install I have only .ts files in node_modules

from ng2-datepicker.

jkuri avatar jkuri commented on July 17, 2024

@igisav you were right. try again please.

from ng2-datepicker.

igisav avatar igisav commented on July 17, 2024

No. Still don't work. I got:
Typescript found the following errors:/app/app.component.ts (4, 28): Cannot find module 'ng2-datepicker'

angular-cli-build.js:

vendorNpmFiles: [
      ...
      'ng2-datepicker/**/*.+(js|js.map)'
    ]

system-config.js:

const map: any = { "ng2-datepicker":   "vendor/ng2-datepicker"};
const packages: any = {
   'ng2-datepicker':    { main: 'ng2-datepicker.js', format: 'cjs'}
};

app.component.ts:

import { DatePicker } from "ng2-datepicker";
...
directives: [DatePicker],
....

from ng2-datepicker.

jkuri avatar jkuri commented on July 17, 2024

ng2-datepicker/**/*.+(js|js.map), not sure if that + sign is correct, try wildcard instead. Also, debug your app in developer console network tab, it it's not loaded - its problem with your configuration, not the module itself.

from ng2-datepicker.

igisav avatar igisav commented on July 17, 2024

I give up :(

It throw one error after another. I assume, it depends with "typings": "ng2-datepicker.d.ts",in package.json in your commit ....

I'll try to upgrade whole project to new angular-cli...

Thank you, anyway.

from ng2-datepicker.

jkuri avatar jkuri commented on July 17, 2024

sorry, It's been a while when I was last using configuration with SystemJS and cannot tell you the configuration from the head. Maybe if you can attach a zip I can take a look.

from ng2-datepicker.

jkuri avatar jkuri commented on July 17, 2024

#62

from ng2-datepicker.

sunillokhande avatar sunillokhande commented on July 17, 2024

can anybody has solution for this :
I am using md2-datepicker with angular cli. I am getting the below error while "ng serve" but app works fine with the date picker but "ng build --prod" is not working.

Error :
ERROR in Error encountered resolving symbol values statically. Calling function 'Md2DatepickerModule', function calls are not supported. Consider replacing the function or lambda with a
reference to an exported function, resolving symbol AppModule in D:/HubnetAmazon/Trunk/HubnetAngular2UI/hubnet-new-ui/src/app/app.module.ts, resolving symbol AppModule in D:/HubnetAmazon
/Trunk/HubnetAngular2UI/hubnet-new-ui/src/app/app.module.ts

My OS : windows 7 64 bit
My Angular Cli version : 1.0.0-rc.0
My Md2DatepickerModule Version : 0.0.1-alpha.1

from ng2-datepicker.

Related Issues (20)

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.