我正在跟踪https://github.com/SortableJS/angular-sortablejs,而systemjs.config.js是我陷入困境的地方。我有一个离子3角4应用程序。
我在资产/js/中创建了一个名为systemjs.config.js的脚本,然后将它作为head部分的最后一行包含在index.html中
<script src="assets/js/systemjs.config.js"></script>然而,这样做,它抱怨它找不到系统。这是脚本System.config(Config)中的最后一行;
如果忽略上述步骤,则最终无法绑定sortablejs属性错误。我的.ts和.html如下所示:
<h2>Drag / drop the item</h2>
<div [sortablejs]="items">
<div *ngFor="let item of items">{{ item }}</div>
</div>
<hr>
<h2>See the result</h2>
<div>
<div *ngFor="let item of items">{{ item }}</div>
</div>.ts
import { Component, ViewChild, AfterViewInit } from '@angular/core';
@Component({
selector: 'dynamic-home',
templateUrl: 'dynamic-home.html'
})
export class DynamicHomeComponent implements AfterViewInit{
items = [1, 2, 3, 4, 5];
}app.module.ts
import { SortablejsModule } from 'angular-sortablejs'
@NgModule({
declarations: [],
imports: [
SortablejsModule
]dyamicHome.ts
import { sortablejs } from 'sortablejs'发布于 2017-09-25 02:32:35
我不知道这里有什么问题,所以我用了另一种叫做dragula https://github.com/valor-software/ng2-dragula的东西
这就像一种魅力
https://stackoverflow.com/questions/46381477
复制相似问题