Skip to content

Conversation

@zyahav
Copy link
Contributor

@zyahav zyahav commented Jan 2, 2017

No description provided.

<script type="application/javascript">
window.onload = function() {
require(['config'], function() {
require(['jquery'], function($) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to join multiple require statements using more than one dep:
require(['config', 'jquery'], function(config, $) {

require(['config'], function() {
require(['jquery'], function($) {
$(document).ready(function() {
require(['jquery','tmpl','ajaxGet'], function($, tmpl, ajaxGet) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You already have jquery. Why not move all these deps into the require statement above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i need your help about it
it did not work for me

$('#button1').click(function() {
ajaxGet('json/data.json', function(phoneBookData) {
$('li').remove();
$("#phoneBookTemplate").tmpl( phoneBookData )
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't phoneBookData contain a list of items? Isn't the template for 1 item? Should you not need to loop over it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i did {{each name}}.......{{/each}} do not work
and i did remove it and it loops :)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants