Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
angular2-swiper-wrapper
Advanced tools
Readme
This is an Angular 2 wrapper library for swiper.
See a live example application here.
npm install
npm run build
cd example
npm install
npm start
npm install angular2-swiper-wrapper --save-dev
import { SwiperModule } from 'angular2-swiper-wrapper';
import { SwiperConfigInterface } from 'angular2-swiper-wrapper';
const SWIPER_CONFIG: SwiperConfigInterface = {
direction: 'horizontal',
slidesPerView: 'auto',
keyboardControl: true
};
@NgModule({
...
imports: [
...
SwiperModule.forRoot(SWIPER_CONFIG)
]
})
This library provides two ways to create a Swiper element, simple component and custom directive.
COMPONENT USAGE
Simply replace the element that would oridinarily be passed to Swiper
with the swiper component.
<swiper [config]="config" (indexChange)="onIndexChange($event)">
<div>
Swiper content
</div>
</swiper>
[config] // Custom config to override the global defaults.
(indexChange) // Event handler for the swiper index change event.
[runInsideAngular] // Run Swiper function calls inside the angular zone.
DIRECTIVE USAGE
When using only the directive you need to provide your own theming or import the default theme:
@import 'https://cdnjs.cloudflare.com/ajax/libs/Swiper/3.4.0/css/swiper.min.css';
Swiper directive can be used in correctly structured div element with optional custom configuration:
<div [swiper]="config" class="swiper-container" (indexChange)="onIndexChange($event)">
<div class="swiper-wrapper">
<div class="swiper-slide">
Swiper content
</div>
</div>
<div class="swiper-scrollbar"></div>
<div class="swiper-pagination"></div>
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
[swiper] // Can be used to provide optional custom config.
(indexChange) // Event handler for the swiper index change event.
[runInsideAngular] // Run Swiper function calls inside the angular zone.
direction // Direction of the swiper (Default: 'horizontal').
threshold // Distance needed for the swipe action (Default: 0).
spaceBetween // Space in pixels between the swiper items (Default: 0).
slidesPerView // Number of the items per view or 'auto' (Default: 1).
centeredSlides // Align active item on center not left (Default: false).
keyboardControl // Enables navigation through arrow keys (Default: false).
For more detailed documentation with all the supported options see swiper documentation.
FAQs
Angular 2 wrapper library for Swiper
The npm package angular2-swiper-wrapper receives a total of 29 weekly downloads. As such, angular2-swiper-wrapper popularity was classified as not popular.
We found that angular2-swiper-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.