question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work for me

See original GitHub issue

** 1st error without editing system.config **

error

Steps that I did

  1. npm install ng2-datepicker --save

Since I used ionicons in my app. I didn’t add it again but I also tried it to put in my index.html.

  1. Import module

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

  1. Used it on my component. I used reactive forms.

<datepicker formControlName="dateFrom" [expanded]="true"></datepicker>

** 2nd error **

error2

When I add this to systemjs.config.js

map: { 'ng2-datepicker': 'npm:ng2-datepicker', 'moment': 'npm:moment', }, packages: { 'ng2-datepicker': { main: 'ng2-datepicker.js', defaultExtension: 'js' }, 'moment': { main: 'moment.js', defaultExtension: 'js' } }

I’m not going to use it for all the components. Just for several components.

Any help would be appreciated. Thanks

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:14 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ghetolaycommented, Oct 15, 2016

I think the best way to use custom css for now would be something like that :

import { DatePickerComponent } from 'ng2-datepicker/src/component/ng2-datepicker';

@Component({
    selector: 'my-datepicker',
    templateUrl: './node_modules/ng2-datepicker/src/components/ng2-datepicker.component.html',
    styleUrls: [ './mydatepicker.css' ],
    providers: [{
        provide: NG_VALUE_ACCESSOR,
        useExisting: forwardRef(() => MyDatepickerComponent),
        multi: true
   }]
})
export class MyDatepickerComponent extends DatePickerComponent { }

You may need to adapt template/style urls to your build system but that’s the spirit.

We’re working on a better way to customize DatePicker.

0reactions
tryshchenkocommented, Nov 12, 2016

@ghetolay thanks for your response, but I’ve already solved a problem in the other way, and lost those lines of code. We had to implement a bunch of custom functionality so we’ve decided to proceed with a custom solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is the difference between "it doesn't work for ... - HiNative
(2) It doesn't work for me means 1. a particular method/way of doing something does not work for the person 2. something is...
Read more >
“That doesn't work for me.”. A How to Guide on Being Assertive
In a world full of people pleasing, being assertive is a needed trait. It forces you to strike the perfect balance.
Read more >
"This doesn't work for me" is the biggest mistake you'll make
Mindset matters in your small business. Learn how this simple statement "this doesn't work for me" can cripple your business, and what to...
Read more >
It doesn't work for me - WordReference Forums
It means that talking to ten different people about the same things is unacceptable to him, Kohlridg. This is nothing that he wants...
Read more >
it doesn't work to me or it doesn't work for me? - TextRanch
It doesn't work for me to go on with this thing, with such a wide gulf between those who understand, love and are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found