EasyUI Forum
May 23, 2018, 05:36:40 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: MessagerService component cannot be used  (Read 145 times)
fengdie
Newbie
*
Posts: 18


View Profile Email
« on: May 06, 2018, 01:32:56 AM »

<eui-messager> </ eui-messager> is not used in the template MessagerService component cannot be used
Code:
import { Component } from '@angular/core';
import { MessagerService } from 'easyui/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>
        
    `
})
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!'
        });
    }
 
}

Suggest MessagerService like easyui for jquery messager components.
Don't insert <eui-messager> </ eui-messager> node
« Last Edit: May 08, 2018, 02:45:25 AM by fengdie » Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!