EasyUI Forum

General Category => EasyUI for Angular => Topic started by: fengdie on May 05, 2018, 12:41:15 AM



Title: MessagerService add euiDraggable tag invalid
Post by: fengdie on May 05, 2018, 12:41:15 AM
Code:
import { Component } from '@angular/core';
import { MessagerService } from 'ng-easyui/components/messager/messager.service';
 
@Component({
    selector: 'app-root',
    template: `
        <h2>Alert Messager</h2>
        <eui-linkbutton (click)="alert1()">Alert</eui-linkbutton>
        <eui-linkbutton (click)="alert2()">Error</eui-linkbutton>
        <eui-linkbutton (click)="alert3()">Info</eui-linkbutton>
        <eui-linkbutton (click)="alert4()">Question</eui-linkbutton>
        <eui-linkbutton (click)="alert5()">Warning</eui-linkbutton>
        <eui-messager euiDraggable ></eui-messager>
    `
})
export class AppComponent {
    constructor(public messagerService: MessagerService) {}
 
    alert1() {
        this.messagerService.alert({
            title: 'Alert',
            msg: 'Here is a message!'
        });
    }
    alert2() {
        this.messagerService.alert({
            title: 'Error',
            icon: 'error',
            msg: 'Here is an error message!'
        });
    }
    alert3() {
        this.messagerService.alert({
            title: 'Info',
            icon: 'info',
            msg: 'Here is a info message!'
        });
    }
    alert4() {
        this.messagerService.alert({
            title: 'Question',
            icon: 'question',
            msg: 'Here is a question message!'
        });
    }
    alert5() {
        this.messagerService.alert({
            title: 'Warning',
            icon: 'warning',
            msg: 'Here is a warning message!'
        });
    }
 
}


Title: Re: MessagerService add euiDraggable tag invalid
Post by: jarry on May 05, 2018, 07:32:06 AM
Please update to a newer version and set the 'draggable' property to true to display a draggable message dialog.
Code:
this.messagerService.alert({
    title: 'Alert',
    msg: 'Here is a message!',
    draggable: true
});