Comments (13)
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.
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.
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.
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.
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.
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.
@igisav you were right. try again please.
from ng2-datepicker.
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.
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.
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.
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.
from ng2-datepicker.
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)
- about @hotlistener
- Automatic dropdown position feature request
- Option to not apply default input styles
- Not work with ReactiveForms
- How to clear selected date from UI? HOT 1
- ngModel null issue HOT 2
- The calendar remains opened even after the input looses focus
- Open calendar pop up on icon click event as well as input field
- Ability to keep calendar open after selecting a date
- How can i disable specific days like sunday, monday or whatever I need? HOT 1
- display month list
- Not showing dates in Saturday column on latest version of Edge on Windows HOT 2
- Locale option doesn't work with date-fns > 2
- Resetting a datepicker causes a jump, back to 1970 HOT 3
- upgrade to angular9 occurs error HOT 3
- Set value manually
- What happened to the headless attribute ? HOT 1
- Stackblitz
- Demo link taking users to malware
- Update UI when used in a reactive form.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng2-datepicker.