-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples not working on angular 10 #311
Comments
Hi @AntonGrekov , |
Sure. The first issue i met was TypeScript error that i was unable to fix(due to my beginner skills in TS), i tried many ways. Error is the following: ERROR in error TS7006: Parameter 'j' implicitly has an 'any' type.
public carouselTileLoad(j) {
error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ 0: never[]; 1: n
ever[]; 2: never[]; 3: never[]; 4: never[]; 5: never[]; }'.
const len = this.carouselTiles[j].length;
~~~~~~~~~~~~~~~~~~~~~
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ 0: never[]; 1: ne
ver[]; 2: never[]; 3: never[]; 4: never[]; 5: never[]; }'.
this.carouselTiles[j].push(
~~~~~~~~~~~~~~~~~~~~~ Related code (taken from 1st example) : public carouselTiles = {
0: [],
1: [],
2: [],
3: [],
4: [],
5: []
};
public carouselTileLoad(j) {
// console.log(this.carouselTiles[j]);
const len = this.carouselTiles[j].length;
if (len <= 30) {
for (let i = len; i < len + 15; i++) {
this.carouselTiles[j].push(
this.imgags[Math.floor(Math.random() * this.imgags.length)]
);
}
}
} |
Our angular versions are next:
TS - "typescript": "~3.9.5" |
Got it, looks like your project using strict mode, we will get it fixed, need to change the types internally. Thanks for the help. |
Great. I was stuck how to make an interface in this particular situation. Would be great if you can point me in the correct direction(typescript article i need to read) or show me how interface should look like. And if i remove that method. I get following errors that may be related to angular version:
|
When are you guys fixing it? |
@santoshyadavdev - Even if you don't have time to actually fix this issue yet, can you at least explain (or point us to an explanation of) the intended logic here? <li *ngFor="let j of myCarousel.pointNumbers; let j = index" (...omitted...)></li> (This is directly from the example at https://www.npmjs.com/package/@ngu/carousel, and it is not valid template code because Which is it? Is Any advice you can give is appreciated -- thanks! |
This issue has been automatically marked as stale because it has not had recent activity for 6 months. It will be closed if no further activity occurs. Thank you for your contributions. |
Closing this issue due to no activity for 6 months. |
Hi, guys, i have no other place to ask and share my experience.
Our project has mat-angular + ngBootstrap ui libs connected. And none of them has a solution for carousel we need.
Our need is pretty simple one - just a regular carousel with 4-5 items shown in single slide, nothing special.
We need to filter data by input. Data comes from store observable.
Finally i got ngu-carousel to do what i need but it took a lot of time. We are using angular 10, and all examples on github home page of this project rely to lower version. None of them are building on angular 10 - many errors, typescript errors, variable scope errors.
I was unable to find any other carousel for out project without connecting huge libraries. Do you know any ?
https://www.npmjs.com/package/ngx-slick-carousel - was a good one at start - simple setup, also known options(worked with it before), but i was unable to make it work with filtered observable data, and i don't like including jquery only for carousel
ngu-carousel looked to me like a live, advanced project with many options and contributors, but documentation and examples could be better for begginers to start with.
The text was updated successfully, but these errors were encountered: