javascript - 在 ion-slide 中设置不同的 html 文件

标签 javascript jquery html cordova ionic-framework

我是 ionic 的新手,我必须在每个 ion-slide 中设置不同的 html 文件。

<ion-slide>
Here i have to set home.html file
<h3 class="text-center">slide2</h3>
</ion-slide>
<ion-slide>
Here i have to set city.html file
<h3 class="text-center">slide2</h3>
</ion-slide>
<ion-slide>
Here i have to set test.html file
<h3 class="text-center">slide2</h3>
</ion-slide>

最佳答案

您可以使用 ng-include 来做到这一点指示。 Working plunker .

<ion-view title="{{tab.name}}">
    <ion-content class="has-header" padding="true">
        <ion-slide-box>
            <ion-slide>
                <ng-include src="'home.html'"></ng-include>
                <h3 class="text-center">slide2</h3>
            </ion-slide>
            <ion-slide>
                <ng-include src="'city.html'"></ng-include>
                <h3 class="text-center">slide2</h3>
            </ion-slide>
            <ion-slide>
                <ng-include src="'test.html'"></ng-include>
                <h3 class="text-center">slide2</h3>
            </ion-slide>
        </ion-slide-box>
    </ion-content>
</ion-view>

关于javascript - 在 ion-slide 中设置不同的 html 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34543111/

相关文章:

javascript - 编辑我在表单字段中提交的元素

iphone - UIWebView 的内容颜色意外改变

javascript - 不应使用 keydown 事件的 'charCode' 属性。值没有意义

javascript - TypeORM AfterSave() 在创建后触发,但在查询时返回 NULL

jquery - jquery 的 click() 事件

html - CSS 中的独立属性选择器

python - 在 Flask 中打印元组列表

javascript - 在 JavaScript 文件中混合 JSF EL

javascript - 如何点击播放歌曲?

javascript - 这会在 IE 中泄漏吗?