Sfoglia il codice sorgente

using handlebars' typings

Raanan Weber 7 anni fa
parent
commit
b68364e6b5
2 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 1 0
      Viewer/package.json
  2. 2 2
      Viewer/src/templating/templateManager.ts

+ 1 - 0
Viewer/package.json

@@ -23,6 +23,7 @@
     },
     "homepage": "https://github.com/BabylonJS/Babylon.js#readme",
     "devDependencies": {
+        "@types/handlebars": "^4.0.37",
         "@types/node": "^8.9.4",
         "base64-font-loader": "0.0.4",
         "base64-image-loader": "^1.2.1",

+ 2 - 2
Viewer/src/templating/templateManager.ts

@@ -2,7 +2,7 @@
 import { Observable, IFileRequest, Tools } from 'babylonjs';
 import { isUrl, camelToKebab, kebabToCamel } from '../helper';
 
-import * as Handlebars from '../../assets/handlebars.min.js';
+import * as Handlebars from 'handlebars';
 import { EventManager } from './eventManager';
 import { ITemplateConfiguration } from '../configuration/interfaces';
 import { deepmerge } from '../helper/';
@@ -321,7 +321,7 @@ export class Template {
         this.initPromise = htmlContentPromise.then(htmlTemplate => {
             if (htmlTemplate) {
                 this._htmlTemplate = htmlTemplate;
-                let compiledTemplate = Handlebars.compile(htmlTemplate, { noEscape: (this._configuration.params && this._configuration.params.noEscape) });
+                let compiledTemplate = Handlebars.compile(htmlTemplate, { noEscape: (this._configuration.params && !!this._configuration.params.noEscape) });
                 let config = this._configuration.params || {};
                 this._rawHtml = compiledTemplate(config);
                 try {