[magnolia-dev] [JIRA] (JSMODELS-4) Provide samples of how to use JS models

"JIRA (on behalf of Christopher Zimmermann)" <jira-O8DnXSz/[email protected]>
Newsgroups gmane.comp.cms.magnolia.devel
Message-ID <[email protected]>
Christopher Zimmermann created an issue

Magnolia Javascript Models / https://jira.magnolia-cms.com/browse/JSMODELS-4 JSMODELS-4

Provide samples of how to use JS models

Issue Type:
Task

Assignee:
Jaroslav Simak

Created:
16/May/17 4:12 PM

Priority:
Neutral

Reporter:
Christopher Zimmermann

We should provide samples of how to work with Magnolia FTL data-structures in JS models.
They can be tricky to work with because one needs to know the data structure that is passed in to a JS function from the FTL. Samples will help with this and give developers a good starting point.

Samples can also help to illustrate possible use cases for the feature.
(Initiative validation: https://wiki.magnolia-cms.com/display/PMTEAM/Template+model+LDV )

Use cases to demonstrate:

- Keep templates simpler by moving logic into model.

- Processing the post of a frontend form.

- Communicating with Magnolia internals.

- Making a REST GET or POST

Probably the samples can best be delivered as one light module.

I created a few samples while testing the feature that may be useful as a starting point:
https://git.magnolia-cms.com/users/czimmermann/repos/js-model-samples/browse/light-modules/js-model-samples

There are some notes here: https://wiki.magnolia-cms.com/display/PMTEAM/LD+Testing+-+JS+Models

The samples should be documented with a README in the project, and should also be mentioned in Magnolia docs.

https://jira.magnolia-cms.com/browse/JSMODELS-4#add-comment
Add Comment

This message was sent by Atlassian JIRA (v7.2.6#72008-sha1:26175bf)

----------

----------------------------------------------------------------

For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html

Alternatively, use our forums: http://forum.magnolia-cms.com/

To unsubscribe, E-mail to: <[email protected]>

----------------------------------------------------------------
(unnamed) (image/gif, 98 B) - not displayed
(unnamed) (image/png, 1.1 KB) - not displayed
(unnamed) (image/png, 468 B) - not displayed
(unnamed) (image/png, 2.9 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.