Pārlūkot izejas kodu
Use fetched template in usage example
Blooper introduced when making the usage examples in README.md
more modern a couple of days ago, where the example fetching the
mustache template over HTTP, didn't in fact use the fetched template.
tags/v4.0.0
Phillip Johnsen
GitHub
pirms 6 gadiem
vecāks
revīzija
5938104ba7
Šim parakstam datu bāzē netika atrasta zināma atslēga
GPG atslēgas ID: 4AEE18F83AFDEB23
1 mainītis faili ar
0 papildinājumiem un
1 dzēšanām
-
README.md
|
|
|
@@ -92,7 +92,6 @@ function renderHello() { |
|
|
|
fetch('template.mustache') |
|
|
|
.then((response) => response.text()) |
|
|
|
.then((template) => { |
|
|
|
var template = document.getElementById('template').innerHTML; |
|
|
|
var rendered = Mustache.render(template, { name: 'Luke' }); |
|
|
|
document.getElementById('target').innerHTML = rendered; |
|
|
|
}); |
|
|
|
|