Giter Site home page Giter Site logo

Comments (7)

loskael avatar loskael commented on May 24, 2024

这个需要配置轮播时间,参考: https://valor-software.com/ng2-bootstrap/#/carousel#dynamic

解决这类问题要学会看文档,一般 demo 很难覆盖所有的使用情形,在本例中解决方案如下:
源码:

- <carousel>
+ <carousel [interval]="3000">

from angular2-questionnaire.

alexwjm avatar alexwjm commented on May 24, 2024

多谢,node_modules 下源码说默认interval为5秒,手动不设也可以,貌似在ngFor的情况下必须设置此变量

from angular2-questionnaire.

loskael avatar loskael commented on May 24, 2024

给出的链接后面有参数说明:

Type: number
Delay of item cycling in milliseconds. If false, carousel won't cycle automatically.

from angular2-questionnaire.

alexwjm avatar alexwjm commented on May 24, 2024

多谢
代码原注释比较奇怪,说的是proerties
而且前几个example (非循坏)不设置都是默认可以工作的
interval
Type: number
Default value: 5000
Default interval of auto changing of slides

from angular2-questionnaire.

loskael avatar loskael commented on May 24, 2024

简单看了一下源码, 你说的注释是这个:
https://github.com/valor-software/ng2-bootstrap/blob/a33dc10724bbd7c338f0fbd4fd4935eaf73133f3/src/carousel/carousel.component.ts#L13
https://github.com/valor-software/ng2-bootstrap/blob/c6ba82d7bb51136c76ae9b395bb50e0c3ae27242/src/carousel/carousel.config.ts#L6

实际上 interval 是这里处理的
https://github.com/valor-software/ng2-bootstrap/blob/development/src/carousel/carousel.component.ts#L74-L80
https://github.com/valor-software/ng2-bootstrap/blob/a33dc10724bbd7c338f0fbd4fd4935eaf73133f3/src/carousel/carousel.component.ts#L271

from angular2-questionnaire.

loskael avatar loskael commented on May 24, 2024

这里确实存在误导, ng2 经历的版本变更太多了, ng2-bootstrap 也一样经历过很多次重构, 导致文档注释和代码有些混乱

from angular2-questionnaire.

alexwjm avatar alexwjm commented on May 24, 2024

很高兴一起讨论,贵书已拜读,有浅入深,层次有序,覆盖面广,很推荐大家来看

from angular2-questionnaire.

Related Issues (17)

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.