AncientSwordRage / nWoD-db

Web app for creating new world of darkness characters and browsing character data (Mage spells, vampire disciplines merits, etc)
1 stars 0 forks source link

JSON attributes are unsorted #10

Open AncientSwordRage opened 9 years ago

AncientSwordRage commented 9 years ago

Incorrectly sorted attributes

Attributes are unordered.

This is because the current attributes are as such:

"Mental": {
            "Level": 2,
            "Intelligence": 1,
            "Wits": 1,
            "Resolve": 1
        },

JSON will need to be altered to state 'order' or type (Power/Fineese/Resistance).

Not sure how best to do so, and thus tell Angular how to order them:

e.g. {{ data| orderBy : ????}}

rozza2058 commented 9 years ago

attributes: { mental: [ { name: intelligence, value: 1, order: 1 } ] }

should do it, if you use ng-repeat="attr in mentalattributes | orderBy:'order'".

On Tue, Mar 3, 2015 at 10:06 AM, AncientSwordRage notifications@github.com wrote:

[image: Incorrectly sorted attributes] https://camo.githubusercontent.com/7bda09b29bbd205b44fd62ae1d9359f7076bc8a3/687474703a2f2f692e737461636b2e696d6775722e636f6d2f584d6e59782e706e67

Attributes are unordered. Not sure how best to tell Angular how to order them:

e.g. {{ data| orderBy : ????}}

— Reply to this email directly or view it on GitHub https://github.com/AncientSwordRage/nWoD-db/issues/10.

AncientSwordRage commented 9 years ago

@rozza2058 that works, but I need to specify in the backend somewhere about the order, before I create the JSON for Angular noms.

rozza2058 commented 9 years ago

Yes, you would. That's your area. You don't have to order it if you don't want to - the front end can take care of the ordering to display it.

On Tue, Mar 3, 2015 at 11:09 AM, AncientSwordRage notifications@github.com wrote:

@rozza2058 https://github.com/rozza2058 that works, but I need to specify in the backend somewhere about the order, before I create the JSON for Angular noms.

— Reply to this email directly or view it on GitHub https://github.com/AncientSwordRage/nWoD-db/issues/10#issuecomment-76926686 .

AncientSwordRage commented 9 years ago

@rozza2058 Yeah, That's my areas thus assigning it to my self :stuck_out_tongue_closed_eyes:.

How could this be handled by the front end without changing the JSON?

rozza2058 commented 9 years ago

Common sense. We know what the order should be, so we find the attribute that matches the expected name.

On Tue, Mar 3, 2015 at 12:05 PM, AncientSwordRage notifications@github.com wrote:

@rozza2058 https://github.com/rozza2058 Yeah, That's my areas thus assigning it to my self [image: :stuck_out_tongue_closed_eyes:].

How could this be handled by the front end without changing the JSON?

— Reply to this email directly or view it on GitHub https://github.com/AncientSwordRage/nWoD-db/issues/10#issuecomment-76933632 .

AncientSwordRage commented 9 years ago

Ah the old fashioned way. On 3 Mar 2015 12:14, "rozza2058" notifications@github.com wrote:

Common sense. We know what the order should be, so we find the attribute that matches the expected name.

On Tue, Mar 3, 2015 at 12:05 PM, AncientSwordRage < notifications@github.com> wrote:

@rozza2058 https://github.com/rozza2058 Yeah, That's my areas thus assigning it to my self [image: :stuck_out_tongue_closed_eyes:].

How could this be handled by the front end without changing the JSON?

— Reply to this email directly or view it on GitHub < https://github.com/AncientSwordRage/nWoD-db/issues/10#issuecomment-76933632

.

— Reply to this email directly or view it on GitHub https://github.com/AncientSwordRage/nWoD-db/issues/10#issuecomment-76934631 .