Skip to content
This repository was archived by the owner on Aug 24, 2020. It is now read-only.

Commit c9e8f7f

Browse files
Update README
1 parent a141144 commit c9e8f7f

File tree

1 file changed

+31
-36
lines changed

1 file changed

+31
-36
lines changed

README.MD

Lines changed: 31 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
# ionic-swing
22

3+
ionic-swing is a fork of the following projects intended to add the swipeable cards capatibilies to Ionic (> 2)
4+
5+
- swing.js (version 4.2.0, https://github.com/gajus/swing)
6+
- angular2-swing (version 0.11.0, https://github.com/ksachdeva/angular2-swing)
7+
8+
The main reason behind this fork is that I was facing a problem with hammerjs, which was freezing the scrolling of my application's on iOS and Android when I was using (swipe) on a list or on an ion-scroll.
9+
After having unsuccessfully tried many solutions I was thinking, after all, that Ionic already include is own version of hammer.
10+
Therefore I decided to create this fork with the goal to make a version of swing.js which doesn't embed any external hammerjs.
11+
12+
## Current status
13+
14+
This fork project is in beta version but seems to work.
15+
16+
Possible improvements not yet done:
17+
18+
- Improve typescripting and remove class swing.ts
19+
- The fork special dependencies are, inherited from swing.js, lodash, raf, rebound, sister, vendor-prefix. For bundle size reason mostly, it should be checked if these can't be replaced with native code or smaller libs.
20+
321
## Installation
422

523
To install this library, run:
@@ -8,50 +26,27 @@ To install this library, run:
826
$ npm install ionic-swing --save
927
```
1028

11-
## Consuming your library
29+
## Usage
1230

13-
Once you have published your library to npm, you can import your library in any Angular application by running:
31+
### 1. Import the IonicSwingModule
1432

15-
```bash
16-
$ npm install ionic-swing
17-
```
18-
19-
and then from your Angular `AppModule`:
33+
In your app.module.ts, import the library like following:
2034

21-
```typescript
22-
import { BrowserModule } from '@angular/platform-browser';
23-
import { NgModule } from '@angular/core';
35+
import {IonicSwingModule} from 'ionic-swing';
2436

25-
import { AppComponent } from './app.component';
37+
and add it to your imports:
2638

27-
// Import your library
28-
import { SampleModule } from 'ionic-swing';
39+
imports: [
40+
...
41+
IonicSwingModule
42+
...
43+
]
2944

30-
@NgModule({
31-
declarations: [
32-
AppComponent
33-
],
34-
imports: [
35-
BrowserModule,
45+
### 2. To implement a card stack
3646

37-
// Specify your library as an import
38-
LibraryModule
39-
],
40-
providers: [],
41-
bootstrap: [AppComponent]
42-
})
43-
export class AppModule { }
44-
```
45-
46-
Once your library is imported, you can use its components, directives and pipes in your Angular application:
47+
To implement a card stack, follow the example provided by angular2-swing
4748

48-
```xml
49-
<!-- You can now use your library component in app.component.html -->
50-
<h1>
51-
{{title}}
52-
</h1>
53-
<sampleComponent></sampleComponent>
54-
```
49+
See https://github.com/ksachdeva/angular2-swing
5550

5651
## Development
5752

0 commit comments

Comments
 (0)