Coder Social home page Coder Social logo

gabrielbusarello / material2-carousel Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gbrlsnchs/material2-carousel

35.0 35.0 31.0 3.03 MB

A carousel component for Angular using Material

Home Page: https://gabrielbusarello.github.io/material2-carousel

License: MIT License

JavaScript 2.54% TypeScript 63.58% HTML 26.44% SCSS 7.44%

material2-carousel's People

Contributors

alerubis avatar cayan avatar chriswnewman avatar dependabot[bot] avatar gabrielbusarello avatar gbrlsnchs avatar lenart91 avatar normanv41 avatar sanscripter avatar tiagoblackcode avatar urohith173 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

material2-carousel's Issues

Bug: NG0100: ExpressionChangedAfterItHasBeenCheckedError

I used the default example and when I removed *ngFor.
as :

<mat-carousel
....params
>
  <mat-carousel-slide > first slide  </mat-carousel-slide>

  <mat-carousel-slide> second slide  </mat-carousel-slide>
</mat-carousel>

I got an error :

ERROR Error: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: 'undefined'. Current value: '[object Object]'.. Find more at https://angular.io/errors/NG0100

my goal was to make a certain number of slides without using a loop.

Can I solve this error locally?

Thank for your help

Angular 11 support?

Any plans to support Angular 11 (and beyond)? I'm in the process of upgrading to Angular 11 and I get the following when trying to upgrade Angular Material:
Package "@ngbmodule/material-carousel" has an incompatible peer dependency to "@angular/material" (requires "^10.0.1", would install "11.2.10")

Thanks for keeping this project alive!

help indicators css

i need change left 50%

but .carousel-indicators li{ or .carousel-indicators{
in css not working ;C

image

Guideline about overriding SVG icons

In the doc, there is no straight-forward guideline about overriding the back and forward icons. So I jumped into the source code and found out that you need to pass an object to svgIconOverrides attribute.

export interface SvgIconOverrides {
arrowBack: string;
arrowForward: string;
}

Here I tried all possible ways to change the default icons, but no luck!
@gabrielbusarello, can you help please?

Type 'string' is not assignable to type 'number'

Hello,
When trying demo example I got this issue: https://gabrielbusarello.github.io/material2-carousel/
Type 'string' is not assignable to type 'number'.
Error occurs in the template of component CitationComponent.
src/app/citation/citation.component.html:9:5 - error TS2322: Type 'string' is not assignable to type 'number'.

9     interval="5000"
      ~~~~~~~~~~~~~~~

  src/app/citation/citation.component.ts:5:16
    5   templateUrl: './citation.component.html',
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component CitationComponent.
src/app/citation/citation.component.html:10:5 - error TS2322: Type 'string' is not assignable to type 'number'.

10     slides="3"
       ~~~~~~~~~~

  src/app/citation/citation.component.ts:5:16
    5   templateUrl: './citation.component.html',
                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    Error occurs in the template of component CitationComponent.

Code:
<mat-carousel
timings="250ms ease-in"
[autoplay]="true"
proportion="25"

interval="5000"
slides="3"
color="accent"
maxWidth="100%"

[loop]="true"
[hideArrows]="false"
[hideIndicators]="false"
[useKeyboard]="true"
[useMouseWheel]="true"
orientation="ltr"
            [maintainAspectRatio]="false"
<mat-carousel-slide
  #matCarouselSlide 
  *ngFor="let slide of this.SeuleCitation.images; let i = index"
  [image]="slide"
  
  overlayColor="#00000040"
  [hideOverlay]="false"
>
</mat-carousel-slide>
</mat-carousel>

Error while building the component

ERROR in node_modules/@ngbmodule/material-carousel/lib/carousel.module.d.ts:2:10 - error TS2305: Module '"@angular/compiler/src/core"' has no exported member 'ModuleWithProviders'.

2 import { ModuleWithProviders } from '@angular/compiler/src/core';
~~~~~~~~~~~~~~~~~~~

I am using Angular version 14+. Please help me resolve the issue.

Build errors with Angular 14 -- ivy/index.js Error: Emit and "@ngbmodule/material-carousel" has missing dependencies: - @angular/compiler/src/core

The component will not build in Angular 14. I get the following errors. I created a new app with Angular 14 cli..

`./src/main.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):                                       
Error: Emit`
                    
Error: Failed to initialize Angular compilation - The target entry-point "@ngbmodule/material-carousel" has missing dependencies:         
 - @angular/compiler/src/core`

Note that it looks like the path @angular/compiler/src/core no longer exists under node_modules in Angular 14. Instead the typings seem to be aggregated in index.d.ts is at the root of @angular/compiler.

Click event on each slide

Is it possible to enable click event on each slide or image? My requirement is that once users clicks on image or slide, it should do some function like opening another page.

Am I missing something?

Thanks in advance.

issue with import { ModuleWithProviders } from '@angular/compiler/src/core';

we have issue with import, file https://github.com/gabrielbusarello/material2-carousel/blob/master/projects/carousel/src/lib/carousel.module.ts

error message during npm install:
error: node_modules/@ngbmodule/material-carousel/lib/carousel.module.d.ts:2:10 - error TS2305: Module '"@angular/compiler/src/core"' has no exported member 'ModuleWithProviders'.
2 import { ModuleWithProviders } from '@angular/compiler/src/core';

can this import be changed to "from '@angular/core'"?

Angular 13 build error

The npm update over the weekend did not resolve the build errors for angular 13

Error: node_modules/@ngbmodule/material-carousel/lib/carousel.module.d.ts:2:10 - error TS2305: Module '"@angular/compiler/src/core"' has no exported member 'ModuleWithProviders'.

2 import { ModuleWithProviders } from '@angular/compiler/src/core';

complete example

does anyone have a complete example using this component where the images aren't stretched out to the entire width of the carousel? i've been fighting with trying to show the images but they are stretched across the entire carousel and there's no relevant documentation on how to fix or manipulate it.

Thank you

Cannot find name 'MouseWheelEvent' in angular13

I have installed material2-carousel on angular13, but i have this error when running "npm run build":

Error: node_modules/@ngbmodule/material-carousel/lib/carousel.component.d.ts:62:25 - error TS2304: Cannot find name 'MouseWheelEvent'.

62 onMouseWheel(event: MouseWheelEvent): void;

Ability to change background-size style for slide

I had issues over writing the background-size so i just went into the module is switched it from cover to contain
Though I think it would be a nice feature if you could just put that into the HTML

It doesn't work with SSR

If you import this module and compile with Angular Universal Server Side Rendering, then the project does not work, the website does not charge in the browser.

Typescript 4.4 support

Need just to change in carousel.component.ts on line 239:
public onMouseWheel(event: MouseWheelEvent): void {
to
public onMouseWheel(event: WheelEvent): void {

Getting arrow_back and arrow_forward text instead of arrow icons

I have done everything as documented but I don't see the arrows. Am i doing something wrong.

Here is what I have done

<mat-carousel timings="250ms ease-in" [autoplay]="true" interval="3000" color="accent" maxWidth="auto" slides="suggestedUserPhotos?.length" maintainAspectRatio="false" proportion="100" [loop]="true" [hideArrows]="false" [hideIndicators]="false" [useKeyboard]="true" [useMouseWheel]="false" orientation="ltr" > <mat-carousel-slide #matCarouselSlide *ngFor="let slide of suggestedUserPhotos; let i = index" [image]="slide.url" overlayColor="#00000040" [hideOverlay]="true" ></mat-carousel-slide>

Could not resolve dependency

i am receiving this error when running npm i (Angular 13):

While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/material
npm ERR!   @angular/material@"13.1.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/material@"^10.0.1" from @ngbmodule/[email protected]
npm ERR! node_modules/@ngbmodule/material-carousel
npm ERR!   @ngbmodule/material-carousel@"0.7.2" from the root project

i had to use --force to make it work temporary, it is better to be fixed from package itself.

Value could not be determined statically - breaks build

So when adding the line MatCarouselModule.forRoot() into the app module imports it produces a compile time error:

Value at position 7 in the NgModule.imports of AppModule is not a reference
Value could not be determined statically.(-991010)
app.module.ts(30, 5): Unable to evaluate this expression statically.
app.module.ts(30, 5): A value for 'forRoot' cannot be determined statically, as it is an external declaration.

Swipe not working

Hello,

i'm not able to use the swipe function, it seems not working on pc browser and mobile.

I am using angular 9

Goes to first slide on window resize

Hi,
I am facing the same issue as described in this issue gbrlsnchs#45
on the original module.

Would it be possibile to fix it? In the pull request ralftar@728b9ae they suggest it to call slideTo(0) only if width changes, or maybe to connect it to the maxWidth attribute set to a value?

Cannot install the package

run : >npm install --save @ngbmodule/material-carousel
Got :
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/animations
npm ERR! @angular/animations@"^14.0.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/animations@"^10.0.0 || ^11.0.0-0" from @angular/[email protected]
npm ERR! node_modules/@angular/material
npm ERR! peer @angular/material@"^10.0.1" from @ngbmodule/[email protected]
npm ERR! node_modules/@ngbmodule/material-carousel
npm ERR! @ngbmodule/material-carousel@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Daniel\AppData\Local\npm-cache\eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Daniel\AppData\Local\npm-cache_logs\2022-08-28T15_00_53_210Z-debug-0.log

Can you help me ?

thanks,

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.