如何设定咆哮的寿命

时间:2017-10-10 20:38:45

标签: primeng

https://www.primefaces.org/primeng/#/growl

我试图让咆哮声显示3秒钟,我做错了什么?咆哮显示,但不会消失。

<form [formGroup]="editPostForm" >
    <div class="form-group">
        <label for="email">Title:</label>
        <input formControlName = "title" type="text" class="form-control" id="title">
    </div>
    <div class="form-group">
        <label for="post-body">Body:</label>            
        <p-editor formControlName="editor" [style]="{'height':'320px'}" id="text"></p-editor>            
    </div>
    <button type="button" (click)="savePost()" class="btn btn-primary" >Save</button>
    <p-growl [(value)]="msgs" [life]=3000></p-growl>
</form>

[更新]
设置生命属性的正确语法:

<p-growl [(value)]="msgs" life=3000 formControlName="gr1"></p-growl>

1 个答案:

答案 0 :(得分:0)

我不熟悉语法,但基于其他属性,你试过这些吗?

报价

/* eslint-disable no-undef, no-prototype-builtins */ const LinkedList = require('../src/linked-list'); let list; describe('LinkedList', () => { beforeEach(() => { list = new LinkedList(); }); it('should have the methods "addToTail", "removeHead", and "contains"', () => { const hasAddToTail = Object.getPrototypeOf(list).hasOwnProperty('addToTail'); const hasRemoveHead = Object.getPrototypeOf(list).hasOwnProperty('removeHead'); const hasContains = Object.getPrototypeOf(list).hasOwnProperty('contains'); expect(hasAddToTail).toBe(true); expect(hasRemoveHead).toBe(true); expect(hasContains).toBe(true); }); it('should update the tail value when a new node is added', () => { list.addToTail(1); expect(list.tail.value).toBe(1); list.addToTail(2); expect(list.tail.value).toBe(2); }); it('should keep the same head after adding nodes', () => { list.addToTail(1); expect(list.head.value).toBe(1); list.addToTail(2); expect(list.head.value).toBe(1); }); it('should return true from contains if a matching value is found and false otherwise', () => { list.addToTail(1); list.addToTail(2); list.addToTail('hello'); list.addToTail(true); expect(list.contains('hello')).toBe(true); expect(list.contains('asdf')).toBe(false); }); it('should remove head when removeHead is invoked', () => { list.addToTail(1); list.addToTail(2); expect(list.head.value).toBe(1); list.removeHead(); expect(list.head.value).toBe(2); list.removeHead(); expect(list.head).toBe(null); }); it('should return the head that is removed when removeHead is invoked', () => { list.addToTail(1); expect(list.removeHead()).toBe(1); }); it('should not contain removed values', () => { list.addToTail(1); list.addToTail(2); list.addToTail(3); list.addToTail(4); list.removeHead(); expect(list.contains(1)).toBe(false); }); });

括号

[life]="3000"

引号和括号

[(life)]=3000