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

Several 'render' issues #91

Open
jonvuri opened this issue Jun 23, 2014 · 1 comment
Open

Several 'render' issues #91

jonvuri opened this issue Jun 23, 2014 · 1 comment
Labels

Comments

@jonvuri
Copy link
Contributor

jonvuri commented Jun 23, 2014

Dumping this here from issue ractivejs/ractive#749 before it's closed and I forget:

  • Currently, the docs for .render() say that it will throw an error if you call it. This doesn't seem to be the case. In fact... http://docs.ractivejs.org/latest/ractive-render
  • If you try to attach the Ractive instance with .insert() instead, the only other suitable method, you get an error: Uncaught Error: The API has changed - you must call 'ractive.render(target[, anchor])' to render your Ractive instance. Once rendered you can use 'ractive.insert()'. The issue here is that this is not spelled out in the docs (the fact that the instance must already have been rendered before .insert()), though it isn't not said, either. (Why can't it automatically be rendered if needed, though? And why is .render() set to throw a debug error if there's no other way to defer rendering?) http://docs.ractivejs.org/latest/ractive-insert
  • .render() is not listed in the methods that support the Promise interface, despite implementing it. http://docs.ractivejs.org/latest/promises
@jonvuri jonvuri added the bug label Jun 23, 2014
jonvuri added a commit that referenced this issue Jul 15, 2014
Update ractive.render() (Ref #71) (Ref #91)
@rstacruz
Copy link
Contributor

As I noted in #107, it seems that .render() is indeed meant to be public API, and the document was just recently updated to note this. It'd be nice to also document that the .render() method:

  • ...will return a promise.
  • ...takes a second argument anchor.
  • ...is useful when instanciating an Ractive instance without the el option.

A few examples would be swell, too.

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

No branches or pull requests

2 participants