0

angularJs を使用しており、ng-init の配列に複数の値を入力する必要があります。

<div ng-init="script = [
            {tag:'tag1', title:'Title1 here', plot:'here goes the plot1'},
            {tag:'tag2', title:'Title2 here', plot:'here goes the plot2'},
            {tag:'tag3', title:'Title3 here', plot:'here goes the plot3'}
            ]">
</div>

ご想像のとおり、「プロット」フィールドは文字列であり、そこに記述すると非常に大きく混乱する可能性があります。別のファイルから取得することはできますか?たとえば、plot1、plot2、plot3 という 3 つのファイルを作成し、それらを HTML ファイルに呼び出すことができます。

4

2 に答える 2