Skip to content

Commit 765bbe9

Browse files
committed
fix(code style): remove public/private methods and vars
1 parent 767ff53 commit 765bbe9

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/pages/comments/comments.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class CommentsPage {
2424
this.load();
2525
}
2626

27-
private load() {
27+
load() {
2828
this.redditApi.fetchComments(this.post).subscribe((comments) => {
2929
// comments.sort((a,b) => b.score - a.score);
3030
this.comments = comments;

src/pages/posts/posts.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { CommentsPage } from '../comments/comments'
1212
providers: [RedditApiService]
1313
})
1414
export class PostsPage {
15-
public loadCompleted: boolean = false;
15+
loadCompleted: boolean = false;
1616

1717
posts: Array<any>;
1818
commentsPage = CommentsPage;
@@ -21,27 +21,27 @@ export class PostsPage {
2121
this.load();
2222
}
2323

24-
private load(): void {
24+
load() {
2525
this.redditApi.fetchHot().subscribe((posts) => {
2626
this.posts = posts;
2727
this.loadCompleted = true;
2828
console.log(posts)
2929
})
3030
}
3131

32-
public getPostImage(post) {
32+
getPostImage(post) {
3333
let postImage = '';
3434
if (!post.imageError && post.preview) {
3535
postImage = post.preview.images[0].source.url;
3636
}
3737
return postImage;
3838
}
3939

40-
public setImageError(post) {
40+
setImageError(post) {
4141
post.imageError = true;
4242
}
4343

44-
public readPost(post) {
44+
readPost(post) {
4545
let redditUrl = 'https://www.reddit.com/r/'
4646
if (post.url.includes(redditUrl)) {
4747
this.goToComments(post)
@@ -50,11 +50,11 @@ export class PostsPage {
5050
}
5151
}
5252

53-
public goToComments(post) {
53+
goToComments(post) {
5454
this.navCtrl.push(this.commentsPage, {post: post})
5555
}
5656

57-
public goToPost(post) {
57+
goToPost(post) {
5858
window.open(post.url, '_blank');
5959
}
6060

src/providers/reddit-api-service.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,32 @@ export class RedditApiService {
1010

1111
constructor(public http: Http) {}
1212

13-
public fetchHot() {
13+
fetchHot() {
1414
return this.http.get(BASE_URL + JSON_POSTFIX)
1515
.map(this.redditCollectionToJson)
1616
}
1717

18-
public fetchNext(lastPostName: string) {
18+
fetchNext(lastPostName: string) {
1919
return this.http.get(BASE_URL + JSON_POSTFIX + '?count=' + 25 + '&after=' + lastPostName)
2020
.map(this.redditCollectionToJson)
2121
}
2222

23-
public fetchComments(post) {
23+
fetchComments(post) {
2424
let url: string = BASE_URL + post.permalink + JSON_POSTFIX;
2525
return this.http.get(url)
2626
.map(res => res.json()[1].data.children.map(c => c.data).filter(c => c.body))
2727
.map(this.beautifyReplies.bind(this))
2828
}
2929

30-
public beautifyReplies(comments) {
30+
beautifyReplies(comments) {
3131
return comments.map(comment => {
3232
comment.replies = comment.replies ? comment.replies.data.children.map(reply => reply.data).filter(c => c.body) : [];
3333
this.beautifyReplies(comment.replies);
3434
return comment;
3535
})
3636
}
3737

38-
private redditCollectionToJson(response) {
38+
redditCollectionToJson(response) {
3939
return response.json().data.children.map(c => c.data)
4040
}
4141
}

0 commit comments

Comments
 (0)