File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 2
2
3
3
// Use Typescript 1.4 style imports
4
4
import ng = require( "angular2/angular2" ) ;
5
+ import di = require( "angular2/di" ) ;
5
6
6
7
class Service {
7
8
9
+ }
10
+ class Service2 {
11
+
8
12
}
9
13
10
14
class Cmp {
@@ -13,7 +17,7 @@ class Cmp {
13
17
Cmp . annotations = [
14
18
ng . Component ( {
15
19
selector : 'cmp' ,
16
- injectables : [ Service ]
20
+ injectables : [ Service , di . bind ( Service2 ) . toValue ( null ) ]
17
21
} ) ,
18
22
ng . View ( {
19
23
template : '{{greeting}} world!' ,
Original file line number Diff line number Diff line change @@ -602,4 +602,21 @@ declare module "angular2/angular2" {
602
602
*
603
603
*/
604
604
function Switch ( ) : void ;
605
- }
605
+ }
606
+
607
+ declare module "angular2/di" {
608
+ /**
609
+ * Provides an API for imperatively constructing {@link Binding}s.
610
+ *
611
+ * This is only relevant for JavaScript. See {@link BindingBuilder}.
612
+ *
613
+ * ## Example
614
+ *
615
+ * ```javascript
616
+ * bind(MyInterface).toClass(MyClass)
617
+ *
618
+ * ```
619
+ *
620
+ */
621
+ function bind ( token : any ) : any ;
622
+ }
You can’t perform that action at this time.
0 commit comments