handlebars.js

Emberjs1.0.0-RC3: undefined when calling and storing controller method in view variable

。_饼干妹妹 提交于 2019-12-12 03:46:26
问题 In this jsfiddle, inside the didInsertElement hook , I am trying to call a controller method called eventJSON , which is defined in CalendarsController, I am storing or passing that call to the controller action in a variable called calendarJSON that i declared inside the didInsertElement hook in the CalendarsView. But when I log the result, it gives undefined. Also if I put a debugger inside the didInsertElement hook and inspect the variable in the console, it returns undefined. I want to

Using handlebar I get this error :Uncaught TypeError: $(…).geocomplete is not a function

a 夏天 提交于 2019-12-12 03:33:24
问题 I am using this html code that I am trying to implement onto my handlebar file. While it works on the html/javascript file, I can't get it to work in the handlebar file. When I use it in the handlebar, I get this error : Uncaught TypeError: $(...).geocomplete is not a function I am putting the code into main.handlebar: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> <script src="js/jquery.geocomplete.js"></script> <script language = "javascript"> $

Create link in handlebars.js using helper

心不动则不痛 提交于 2019-12-12 02:57:18
问题 I have tried to follow the example in the handlebars documentation on how to create a link, but the instructions are very unclear to me. handlebarsjs.com/expressions.html (see "Helpers") First of all, without the link helper I can make the link text appear on the screen, but just as text, not a link. <script id="template" type="text/x-handlebars-template"> <h4>{{{my_link}}}</h4> </script> And the text is retrieved from an ajax request. Then I add the link keyword <h4>{{{link my_link}}}</h4>

Reloading handlebars partial from marionette view loses access to ui object defined for partial template element within parent view

拜拜、爱过 提交于 2019-12-12 02:49:48
问题 By referring the this link; I am reloading the handlebars partial template from marionette view within my application. In my marionette view I have defined ui object as below ui: { updateCarrierRow: ".hook--edit-carrier-row", dispatchEquipment: ".hook--dispatch-equipment", editButton: ".hook--edit-button", trailerText: "#trailer-text", tractorText: "#tractor-text" }, From which trailerText & tractorText variables are referencing the elements from handlebars template loaded within current view

How/Where to use Custom Handlbars Helpers in Stencil?

扶醉桌前 提交于 2019-12-12 02:49:14
问题 I'm familiar with how to code a custom Handlebars Helper, but where do I put the helper code within the files? I've tried including my own JS file in the head and after the body, but I get the following error in the JS console: Uncaught ReferenceError: Handlebars is not defined Am I doing something wrong or is this a 'feature' of the Stencil implementation of Handlebars? All help greatly appreciated! 回答1: All the helpers are predefined that can be used with Stencil "natively". If you'd like

Send array to function in handlebars?

微笑、不失礼 提交于 2019-12-12 02:28:56
问题 I have the following piece of code... var mainArray = { nestedArrays: { array1:[... items ...], array2:[... items ...] } }; var source = '{{#nestedArrays}}' + '{{#each this}}' + '<div class="listItem" onclick="populateSecondMenu({{SEND THIS ARRAY!}});">' + '<div class="leftSide">' + '<div class="listTitle">Indicator : {{this.length}} </div>' + '</div>' + '</div>' + '{{/each}}' + '{{/items}}'; var template = Handlebars.compile(source); $('.list').html(template(mainArray)); As you can already

Sending object as a variable to Mandrill via Rails

删除回忆录丶 提交于 2019-12-12 02:27:49
问题 I'm converting an email template from Rails to Mandrill, the content for which requires a fair amount of data, some of which is nested through several associations. Therefore, I'd like to pass objects via Mandrill's global_merge_vars, such as the (simplified) following: [{ 'name'=>'order', 'content'=> @order.to_json(include: { user: { only: :first_name } }, methods: [:method1, :method2, :method3, :method4]) }] Which passes through to the mandrill template under the order variable similar to

(Handlebarsjs templating) How to get data from external JSON source?

纵然是瞬间 提交于 2019-12-11 21:34:32
问题 See this link: http://jsfiddle.net/Rousnay/FJzre/ it is working, the JSON data come trough http://json.virtuecenter.com/json-data/blogs/tags?callback=? but it is not working when i want to get data from http://sunday-theater-club.simpletix.eu/API/ThemeUIHandler.asmx/GetMenuItems?callback=? Can anyone help me with jsfiddle example. please. 回答1: The returned data is not valid to the template, when getting from "http://sunday-theater-club.simpletix.eu/API/ThemeUIHandler.asmx/GetMenuItems

Razor model helpers in jquery/handlebars infinite scroll

青春壹個敷衍的年華 提交于 2019-12-11 20:37:29
问题 I'm using MVC5 and originally had a standard MVC implementation with manual paging and all was well. Except, when I showed it to my friend, he's like "What are all these number things down here?" (referring to the paging buttons, in his defense he was using his smart phone). It was then I decided infinite scroll would be much better. After what seems like a million google searches, most the solutions (as well as ALL the solutions that I can actually understand) use json and jquery. Since I

Requirejs is not loading my handlebars dependencies like I expect

∥☆過路亽.° 提交于 2019-12-11 19:50:10
问题 I am trying to load some js files with require. Here is my config file: define(function() { "use strict"; require.config({ hbs : { templateExtension : 'hbs', disableHelpers: true, disableI18n : true }, shim: { 'underscore': { exports: '_' }, 'backbone': { deps: [ 'underscore', 'jquery' ], exports: 'Backbone' }, json2 : { exports: "JSON" }, 'jqueryMockAjax': { exports: '$.mockjax', deps: ['jquery'] } }, paths: { jquery: 'libs/jquery/jquery', jqueryMockAjax: 'libs/jquery-mockjax/jquery.mockjax'