angular-cn/public/docs/js/latest/api/test/beforeEachBindings-function...

30 lines
701 B
Plaintext
Raw Normal View History

.l-main-section
h2(class="function export") beforeEachBindings
pre.prettyprint
code.
beforeEachBindings(fn: any)
p.location-badge.
exported from <a href='../test'>angular2/test</a>
defined in <a href="https://github.com/angular/angular/tree/2.0.0-alpha.36/modules/angular2/src/test_lib/test_lib.ts#L109-L129">angular2/src/test_lib/test_lib.ts (line 109)</a>
:markdown
Allows overriding default bindings defined in test_injector.js.
The given function must return a list of DI bindings.
Example:
beforeEachBindings(() => [
bind(Compiler).toClass(MockCompiler),
bind(SomeToken).toValue(myValue),
]);