它看起來像你幾乎在那裏。只需調整一下,這應該起作用。是在奧裏利亞添加動態組成視圖所需的步驟如下:
創建動態視圖
創建HTML模板。在這種情況下,您需要創建test.html
模板,如下面的代碼片段所示。
的test.html
<template> <div>Hi I'm a test message</div> </template>
撰寫視圖到您的父組件
你所創建的視圖後,您需要使用它撰寫成父組件<compose>
由Aurelia框架提供的自定義元素。在你的情況,你需要做下面的改動你的<welcome>
視圖模板:
<template>
<section class="au-animate">
<h2>${heading}</h2>
<form role="form" submit.delegate="submit()">
<div class="form-group">
<label for="fn">First Name</label>
<input type="text" value.bind="firstName" class="form-control"
id="fn" placeholder="first name">
</div>
<div class="form-group">
<label for="ln">Last Name</label>
<input type="text" value.bind="lastName" class="form-control" id="ln" placeholder="last name">
</div>
<div class="form-group">
<label>Full Name</label>
<p class="help-block">${fullName | upper}</p>
</div>
<compose view="./test.html"></compose>
<button type="submit" class="btn btn-default">Submit</button>
</form>
</section>
</template>
這樣做了以後,你的觀點應該包括在HTML只自定義元素的新的組成如圖所示在這個screengrab。

肖恩,你是一個明星伴侶。我知道我在做一些愚蠢的事情,但看不到它!謝謝你的幫助。 –
沒問題,'compose'在我第一次使用它的時候抓住了我:D –