Dart Documentationangular.mockLogAttrDirective

LogAttrDirective class

A convenient way to assert the order in which the DOM elements are processed.

In your test create:

<div log="foo">...</div>

And then assert:

expect(logger).toEqual(['foo']);
@NgDirective(
   selector: '[log]',
   map: const {
       'log': '@logMessage'
   }
)
class LogAttrDirective implements NgAttachAware {
 final Logger log;
 String logMessage;
 LogAttrDirective(Logger this.log);
 attach() => log(logMessage == '' ? 'LOG' : logMessage);
}

Implements

NgAttachAware

Constructors

new LogAttrDirective(Logger log) #

Creates a new Object instance.

Object instances have no meaningful state, and are only useful through their identity. An Object instance is equal to itself only.

docs inherited from Object
LogAttrDirective(Logger this.log);

Properties

final Logger log #

final Logger log

String logMessage #

String logMessage

Methods

dynamic attach() #

attach() => log(logMessage == '' ? 'LOG' : logMessage);