2017-02-24 46 views

回答

2

有可供角2

https://github.com/seiyria/ng2-sweetalert2

import { SweetAlertService } from 'ng2-sweetalert2'; 

@Component({ 
    providers: [SweetAlertService] 
}) 
export class MyComponent { 

    static get parameters() { 
    return [[SweetAlertService]]; 
    } 

    constructor(swal) { 
    this.swalService = swal; 
    } 

時sweetalert2.min.css裝起來這將工作一個甜蜜的警報模塊。

編輯九月:2017年

棄用截至2017年八月

的您應該使用https://github.com/toverux/ngsweetalert2https://www.npmjs.com/package/sweetalert2

+0

好友,這件事情已於2017年8月6日棄用,我在2017年2月24日發佈了我的答案。 –

+0

沒有問題,但想你之前downvote –

+0

這個答案好 https://stackoverflow.com/a/39891375/5647368 – Taha