2017-06-12 69 views
0

我想實現 - https://github.com/spartaksun/ng2-file-uploader#backend-example-using-plain-php文件上傳與角

我已經安裝NG2文件的上傳,在我component.ts我試圖添加代碼引導,當我加入directives: [UPLOAD_DIRECTIVES],它給我錯誤 - See error

@Component({ 
    selector: 'demo-app', 
    templateUrl: 'app/demo.html', 
    directives: [UPLOAD_DIRECTIVES], 
}) 
+0

使用這個insted-of https://www.npmjs.com/package/ng2-file-upload –

+0

從哪裏得到的PHP代碼 – user2828442

+0

看演示:https://github.com/valor-software/ ng2-file-upload/blob/master/demo/components/file-upload/simple-demo.ts –

回答

0

請從角2

指令讀取最新的文檔不再是@Component的元數據屬性。

請閱讀:https://angular.io/docs/ts/latest/api/core/index/Component-decorator.html

注: 你要使用這個插件是1歲,所以它必須是採用了棱角分明的測試版不是最後一個。

+0

請指導任何示例上傳文件從最新的角度使用PHP [請提供簡單的PHP代碼],我將非常感謝 – user2828442

+0

https://www.youtube.com/watch?v=g9K-buFTM6o,這可能會幫助你。 –

+0

這又是一個老例子,不是/> – user2828442