Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be clearer about what the framework API is for newcomers #60

Closed
keithn opened this issue Apr 11, 2015 · 5 comments
Closed

Be clearer about what the framework API is for newcomers #60

keithn opened this issue Apr 11, 2015 · 5 comments

Comments

@keithn
Copy link

keithn commented Apr 11, 2015

Just thought I'd share my initial impression, I'm going to spend more time digging into exactly what the package is doing ( mainly because there aren't too many options to consider ), but I thought it might be useful to get a "never seen it before" impression of the docs.

I just found mention of this package on the forums when looking for an alternative to autoforms, so I came here and read the documentation.

I was totally lost almost straight away. It felt like it was trying to introduce simple concepts, then rushed off on tangents without introducing all the concepts or making it clear what is the framework parts. The code example seems way too big and NOT simple at all. There's a lot of code to work through and its not clear where the framework is being leveraged and how it all hooks together.

I think you need the most MINIMAL and complete example without any other packages.

Then introduce something more complex that shows a lot more of the advantages.

Make it clear what the framework API is.

Ok, that's my first impression, going to go back, and figure it all out now :-)

@jonjamz
Copy link
Owner

jonjamz commented Apr 11, 2015

Thank you for your feedback. I've been working on a docs rewrite, and it should be up very soon. There are several other issues relating to docs improvements, for example Issue #14 (which says this improvement is long overdue). I hope to close all of them this weekend.

Until then, please don't hesitate to ask questions in this issue. I will do my best to answer quickly.

@keithn
Copy link
Author

keithn commented Apr 11, 2015

I tried to get the "simplest" thing working, and am having trouble

<head>
  <title>hello</title>
</head>

<body>
  {{> testForm}}
</body>

<template name="testForm">
  {{#basicFormBlock schema=schema action=action}}
    {{> basicInput field='testField'}}
  {{/basicFormBlock}}
</template>

and

Template['testForm'].helpers({
  schema: function () {
    return new SimpleSchema({
      testField: {
        type: String,
        max: 3,
        instructions: "Enter a value!"
      }
    });
  },
  action: function () {
    return function (els, callbacks, changed) {
      console.log("[forms] Action running!");
      console.log("[forms] Form data!", this);
      console.log("[forms] HTML elements with `.reactive-element` class!", els);
      console.log("[forms] Callbacks!", callbacks);
      console.log("[forms] Changed fields!", changed);
      callbacks.success(); // Display success message.
      callbacks.reset();   // Run each Element's custom `reset` function to clear the form.
    };
  }
});

I get a form with a field on the screen, but no placeholder text, and nothing happens on submit.

brand new project with :-

autopublish 1.0.3 Publish the entire database to all clients
coffeescript 1.0.6 Javascript dialect with fewer braces and semicolons
insecure 1.0.3 Allow all database writes by default
meteor-platform 1.2.2 Include a standard set of Meteor packages in your app
templates:forms 1.14.0 Dead easy reactive forms with validation.

Meteor 1.1.0.2

@jonjamz
Copy link
Owner

jonjamz commented Apr 12, 2015

I think the reason this isn't working for you is that you didn't follow step 3 of the usage guide?

@jonjamz jonjamz changed the title First Impression, Documentation is very poor on first read Be clearer about what the framework API is for newcomers Apr 12, 2015
@keithn
Copy link
Author

keithn commented Apr 13, 2015

up and running :)

@keithn keithn closed this as completed Apr 13, 2015
@barisro
Copy link

barisro commented Apr 24, 2017

{{> testForm}} {{#basicFormBlock schema=schema action=action}} {{> basicInput field='testField'}} {{/basicFormBlock}}

Where do I set the data ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants