Skip to content

Instantly share code, notes, and snippets.

@petersirka
Last active April 21, 2016 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save petersirka/c359f6df3cbba52e57eabd3735402892 to your computer and use it in GitHub Desktop.
Save petersirka/c359f6df3cbba52e57eabd3735402892 to your computer and use it in GitHub Desktop.
Pomocník
COMPONENT('comments', function() {
var self = this;
self.readonly();
self.rebuild = function() {
AJAX('GET .....', function(response, err) {
if (err)
return;
// akože urobíme nejakú operáciu s Array
response.reverse();
// renderujeme
self.setter(response);
});
};
self.setter = function(value) {
if (!value)
return;
self.html('RENDER');
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment