javascript - "html?v=<%= VERSION %>" หมายความว่าอะไร?
ฉันกำลังมีปัญหาในการหาคำตอบ โดยพื้นฐานแล้ว ?v=<%= VERSION %> กำลังทำอะไรในบรรทัดต่อไปนี้?
'./components/home/home.html?v=<%= VERSION %>
ถ้ามันช่วยได้ ไฟล์ต้นฉบับสามารถดูได้ที่นี่
หรือที่นี่:
import {Component, View} from 'angular2/angular2';
import {RouterLink} from 'angular2/router';
@Component({
selector: 'component-1'
})
@View({
templateUrl: './components/home/home.html?v=<%= VERSION %>',
directives: [RouterLink]
})
export class Home {}
คำตอบ #1
?v=<%= VERSION %>
เทคนิคทั่วไปสำหรับ การล้างแคช
ผลลัพธ์จากการค้นหาอย่างรวดเร็วในหัวข้อ: http://webassets.readthedocs.org/en/latest/expiring.html
คำตอบ #2
ฉันเดาว่านี่น่าจะเหมือน ASP จริง ๆ ดังนั้นจึงเป็นตัวย่อของวิธี Response.Write
<%= VERSION %>
เท่ากับ
<%
Response.Write(VERSION)
%>
บรรทัดนี้กำลังใช้ "write" นี้เพื่อควบคุมเวอร์ชันของเทมเพลต
