We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Create a new HTML attribute to instantiate UIs easily. Many times, the developer is forced to instantiate the UI inside the presenter, e.g.:
View
<div> <div data-id='detail'></div> </div>
Presenter:
self.create = function () { self.ui('detail', iris.path.ui.user_detail); }
With the new attribute, we can instantiate UIs in a simpler way, e.g.:
<div> <div data-ui='user_detail'></div> </div>
In addition, we can create another attribute to automatize the component inflating: data-ui-bind
data-ui-bind
<div data-ui='user_detail' data-ui-bind='user-load'></div>
When the user-load event is triggered in somewhere, the user_detail is inflated. The equivalent in the current version may be:
user-load
user_detail
self.create = function () { self.ui('detail', iris.path.ui.user_detail); self.on('user-load', function (user) { self.ui('detail').inflate(user); } }
Other example (list):
<div data-ui='user_list_item' data-ui-bind='friends-load'></div>
When the friends-load event is triggered in somewhere, the UIs (user_list_item) are instantiated. The equivalent in the current version may be:
friends-load
<div> <div data-id='user_list'></div> </div>
self.on('friends-load', function (users) { self.destroyUIs('user_list'); for ( var i = 0; i < users.length; i++ ) { self.ui('user_list', iris.path.ui.user_list_item).inflate(users[i]); } }
With these attributes we can reduce the presenters size considerably.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Create a new HTML attribute to instantiate UIs easily.
Many times, the developer is forced to instantiate the UI inside the presenter, e.g.:
View
Presenter:
With the new attribute, we can instantiate UIs in a simpler way, e.g.:
View
In addition, we can create another attribute to automatize the component inflating:
data-ui-bind
When the
user-load
event is triggered in somewhere, theuser_detail
is inflated. The equivalent in the current version may be:Presenter:
Other example (list):
When the
friends-load
event is triggered in somewhere, the UIs (user_list_item) are instantiated.The equivalent in the current version may be:
Presenter:
With these attributes we can reduce the presenters size considerably.
The text was updated successfully, but these errors were encountered: