Skip to content

Commit 06395b6

Browse files
committed
Initial commit. Add infinite scroll component. Demo working.
0 parents  commit 06395b6

File tree

85 files changed

+3298
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+3298
-0
lines changed

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
2+
# editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
indent_style = space
8+
indent_size = 2
9+
10+
# We recommend you to keep these unchanged
11+
end_of_line = lf
12+
charset = utf-8
13+
trim_trailing_whitespace = true
14+
insert_final_newline = true
15+
16+
[*.md]
17+
trim_trailing_whitespace = false

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Specifies intentionally untracked files to ignore when using Git
2+
# http://git-scm.com/docs/gitignore
3+
4+
*~
5+
*.sw[mnpcod]
6+
*.log
7+
*.tmp
8+
*.tmp.*
9+
log.txt
10+
*.sublime-project
11+
*.sublime-workspace
12+
.vscode/
13+
npm-debug.log*
14+
15+
.idea/
16+
.sass-cache/
17+
.tmp/
18+
.versions/
19+
coverage/
20+
dist/
21+
node_modules/
22+
tmp/
23+
temp/
24+
hooks/
25+
platforms/
26+
plugins/
27+
plugins/android.json
28+
plugins/ios.json
29+
www/
30+
$RECYCLE.BIN/
31+
32+
.DS_Store
33+
Thumbs.db
34+
UserInterfaceState.xcuserstate

README.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Ionic2 two way infinite scroll component example
2+
3+
### Description
4+
5+
This is a custom infinite scroll component implementation that works in two ways and replaces data instead of adding to it, to prevent DOM stuffing. Basically it's a duplication of the original Ionic2 infinite scroll component (http://ionicframework.com/docs/v2/api/components/infinite-scroll/InfiniteScroll/). After reloading the new data, the content scrolls automatically the the first visible list item before loading. For testing purposes there is a node server that mocks data from a json file.
6+
7+
### How to run demo
8+
9+
* Download the repo and run npm install to install dependencies
10+
* change directory into 'mock-backend' and run 'node server.js'
11+
* try to open 'http://localhost:3333/clients' to test the server
12+
* run 'ionic serve' to run the ionic application
13+
14+
### Problems
15+
16+
* If the infinite is loaded twice, maybe the browser height is to high.
17+
* Maybe adjust the constants in content.utils.js

config.xml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2+
<widget id="com.ionicframework.ionicinfinitescrollexample355670" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
3+
<name>ionic-infinite-scroll-example</name>
4+
<description>An awesome Ionic/Cordova app.</description>
5+
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
6+
<content src="index.html"/>
7+
<access origin="*"/>
8+
<allow-intent href="http://*/*"/>
9+
<allow-intent href="https://*/*"/>
10+
<allow-intent href="tel:*"/>
11+
<allow-intent href="sms:*"/>
12+
<allow-intent href="mailto:*"/>
13+
<allow-intent href="geo:*"/>
14+
<platform name="android">
15+
<allow-intent href="market:*"/>
16+
</platform>
17+
<platform name="ios">
18+
<allow-intent href="itms:*"/>
19+
<allow-intent href="itms-apps:*"/>
20+
</platform>
21+
<preference name="webviewbounce" value="false"/>
22+
<preference name="UIWebViewBounce" value="false"/>
23+
<preference name="DisallowOverscroll" value="true"/>
24+
<preference name="android-minSdkVersion" value="16"/>
25+
<preference name="BackupWebStorage" value="none"/>
26+
<preference name="SplashMaintainAspectRatio" value="true"/>
27+
<preference name="FadeSplashScreenDuration" value="300"/>
28+
<feature name="StatusBar">
29+
<param name="ios-package" onload="true" value="CDVStatusBar"/>
30+
</feature>
31+
</widget>

ionic.config.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "ionic-infinite-scroll-example",
3+
"app_id": "",
4+
"v2": true,
5+
"typescript": true
6+
}

0 commit comments

Comments
 (0)