samuelnygaard/ng2-timezone-selector

Update to Angular version 5

alexbjorlig opened this issue ยท 6 comments

Using this selector in an angular 5 project gives the following warning:

npm WARN ng2-timezone-selector@0.2.3 requires a peer of @angular/core@^4.0.0 but none is installed

I have tried to investigate this a bit (sorry for the late answer), and i can't reproduce the problem when using it for an Angular 5 app, can you provide the package.json file?

With the following angular dependencies:

    "@angular/animations": "5.2.9",
    "@angular/cdk": "^5.2.0",
    "@angular/common": "5.2.9",
    "@angular/compiler": "5.2.9",
    "@angular/core": "5.2.9",
    "@angular/flex-layout": "^5.0.0-beta.13",
    "@angular/forms": "5.2.9",
    "@angular/http": "5.2.9",
    "@angular/material": "^5.2.0",
    "@angular/platform-browser": "5.2.9",
    "@angular/platform-browser-dynamic": "5.2.9",
    "@angular/platform-server": "5.2.9",
    "@angular/router": "5.2.9",
    ...
    "ng2-timezone-selector": "^0.2.3",

I get the warning when building the angular project (not serving).

Hey there, I actually use this package and like it a lot. This is a simple fix. I would update and make a pull request, but I am rather confused by the structure of your git repo and your multiple package.json files.

in "src/package.json", you have the following line in peerDependencies:

    "@angular/core": "^4.0.0"

That's ensuring the above warning is thrown any time the consuming project references a version of @angular/core outside of the 4.X.X versions. Simply release a new version with

    "@angular/core": "^4.0.0 || ^5.0.0"

and that should clear the error.

Hi @ibuchan72390, thanks for the fix and the compliment.
I'm also a bit annoyed by the structure, it is created with the Yo Generator, but I'm scared of breaking the backward capability if I refactor it. I will push version 0.2.4 with the fix in a bit.

@dauledk, will you try to update to the latest version:
npm i --save ng2-timezone-selector@latest
To verify if the issue have been fixed?

It works - thanks for the help @samuelnygaard and @ibuchan72390 !