-1

I am fairly new to famo.us, I have gone through famo.us university tutorials. Now my question is how can we call rest api's in famo.us and bind data from Rest api to the surfaces. Is there any tutorial explaining this? I know there exists famo.us/Angular integration which helps in achieving MVC pattern pretty easily, but is it possible to achieve that using vanilla famo.us?

Regards, Vijay.

Dawson Loudon
  • 6,029
  • 2
  • 27
  • 31
vijay kumar
  • 65
  • 1
  • 7

1 Answers1

0

Famo.us is primarily a rendering/animations framework, so you need to use an external library for that. Most people use jQuery for making Ajax-calls in famo.us. In the callback you can then simply, call the setContent function on the surface to update the content of the surface.

There is also a Utility function in famo.us (Utility.loadURL) which can load data from an URL, but it is very rudimentary.

IjzerenHein
  • 2,690
  • 1
  • 17
  • 13
  • IjzerenHein, thanks for the quick reply, can you point to any of such examples, and is it recommended by famo.us to create surfaces on the fly i.e., surfaces for the result set of the rest api? – vijay kumar Jan 27 '15 at 09:44
  • I don't have an example using jQuery laying around, but it is realy very straightforward. Just look on the jQuery site on how to perform ajax-calls. I do have an example using firebase, which creates surfaces on the firebase callbacks: https://github.com/IjzerenHein/famous-flex-chat – IjzerenHein Jan 28 '15 at 17:42