Collapsible nested comment threads

Collapsible nested comment threads

Collapsible threaded nested comments for Ionic and Angular

Free!

(1)
Nikola Pleša

Nikola Pleša

Member since 2014

Details

Version:
1.0
Size:
2mb
Ionic:
1.0 beta 14,1.0.0,1.0.1
Platforms:
iOS, Android, Windows Phone
View ID:
5946c43b
Released:
8 years ago
Updated:
8 years ago
Category:
Plugins
Tags:
comments, thread, threaded, collapsible, nested, wordpress, reddit, facebook, youtube

Threaded comments for Ionic and Angular. Used for collapsible nested comment threads with multiple levels of indentation for Wordpress, Reddit or various other social networks. Can also be used to display any other list of comments.

Tap on any comment to show replies, swipe it to the left to reveal options.

Install

bower install ionic-threads

Usage

Include ionic.threads.js and ionic.threads.css after the rest of your Ionic and Angular includes.

<script src="lib/ionic-threads/ionic.threads.js"></script>
<link href="lib/ionic-threads/ionic.threads.css" rel="stylesheet">

Add ionic.contrib.ui.ionicThreads as a module dependency of your app. Then use the following AngularJS directives:

<ion-thread comments="comments" post="post"></ion-thread>

Running the demo

Included is an example app that loads the first few posts from the Reddit frontpage, clicking on a post leads to the comment section.

Go to /example folder and run: npm install ionic serve

Customizing

Open up ionic.threads.js and change the ionComment template and add your <ion-option-button> of choice and add the code for the button events.

Included is the ionic.threads.scss if you want to customize the styling. There are variables for colors, font sizes and thread indendation. Add ionic.threads.scss to your scss folder and include it in your ionic.app.scss file with:

@import "www/lib/ionic-threads/ionic.threads.scss";

Used in

Ionic threads is currently used in Updraft for Reddit (www.upvote.io)

Icon by www.somerandomdude.com

Hey there! You'll need to log in before you can leave a comment here.

Alex Dyba

Alex Dyba   ·   8 years ago

Nikola Would you be so nice and give us a schematic view of data objects that are expected by this library? Just single post object and two sub-whatever records to see the structure and how it binds together. I'm having some difficulties to install the demo as npm install has multiple versions objections.

Nikola Pleša

Nikola Pleša   ·   8 years ago

Hi Alex, try running the example without "npm install", I think everything is in the /lib folder and you probably have everything installed already. As for the example objects, the ion-thread directive expects an array of comments. Each comment should contain an array of their child comments. Depending on the API you are using, you will need to update this section of the code: <li ng-repeat="comment in comment.data.replies.data.children">\ <ng-include src="\'node.html\'"/>\ </li>\ "comment.data.replies.data.children" is Reddit's structure, this can be replaced with any array of replies that's a property on the comment object (e.g. comment.replies). The comments themselves have a data object with properties like comment.data.author and comment.data.body, this can be replaced according to your API (in Facebook's case it would be comment.from and comment.message). Cheers, Nikola

Rajkiran Panuganti

Rajkiran Panuganti   ·   8 years ago

Do you have an ionic-v2 version ? I'd love to purchase

Chen Yaw

Chen Yaw   ·   8 years ago

Hello Nikola, This plugin can reply comment?

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

  ·   just now

{{ comment.comment }}

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

  ·   just now

{{ comment.comment }}

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

Chen Yaw

Chen Yaw   ·   8 years ago

Hello Nikola, This plugin can reply comment?

  ·   just now

{{ reply.comment }}



Hey there! You'll need to log in before you can leave a comment here.

Rajkiran Panuganti

Rajkiran Panuganti   ·   8 years ago

Do you have an ionic-v2 version ? I'd love to purchase

Nikola Pleša

Nikola Pleša   ·   8 years ago

Hi Alex, try running the example without "npm install", I think everything is in the /lib folder and you probably have everything installed already. As for the example objects, the ion-thread directive expects an array of comments. Each comment should contain an array of their child comments. Depending on the API you are using, you will need to update this section of the code: <li ng-repeat="comment in comment.data.replies.data.children">\ <ng-include src="\'node.html\'"/>\ </li>\ "comment.data.replies.data.children" is Reddit's structure, this can be replaced with any array of replies that's a property on the comment object (e.g. comment.replies). The comments themselves have a data object with properties like comment.data.author and comment.data.body, this can be replaced according to your API (in Facebook's case it would be comment.from and comment.message). Cheers, Nikola

Alex Dyba

Alex Dyba   ·   8 years ago

Nikola Would you be so nice and give us a schematic view of data objects that are expected by this library? Just single post object and two sub-whatever records to see the structure and how it binds together. I'm having some difficulties to install the demo as npm install has multiple versions objections.

Hey there! You'll need to log in before you can leave a rating here.

Purusothaman Ramanujam   ·     ·   8 years ago

Good..

  ·     ·   just now

{{ rating.comment }}

  ·     ·   just now

{{ rating.comment }}

Purusothaman Ramanujam    ·     ·   8 years ago

Good..