Skip to content

Commit 85d4d13

Browse files
PatrickJSvicb
authored andcommitted
docs(02_directives): TemplateConfig -> @template
Update docs with new template api and remove previous cssUrl api
1 parent ec576ca commit 85d4d13

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

modules/angular2/docs/core/02_directives.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,9 @@ Example of a component:
116116
'title': 'title', | - title mapped to component title
117117
'open': 'open' | - open mapped to component title
118118
}, |
119-
template: new TemplateConfig({ | Define template to be used with component
120-
url: 'pane.html', | - URL of template HTML
121-
cssUrl: 'pane.css' | - URL of CSS to be used with the component
122-
}) |
119+
}) |
120+
@Template({ | Template annotation
121+
url: 'pane.html' | - URL of template HTML
123122
}) |
124123
class Pane { | Component controller class
125124
title:string; | - title property
@@ -231,12 +230,12 @@ class MyService {} | Assume a service which needs to be inject
231230
| into a directive.
232231
|
233232
@Component({ | Assume a top level application component which
234-
selector: 'my-app', | configures the service, template and the
235-
componentServices: [MyService], | directive into which we wish to inject the
236-
template: new TemplateConfig({ | service.
237-
url: 'my_app.html', |
238-
directives: [House] |
239-
}) |
233+
selector: 'my-app', | configures the services to be injected.
234+
componentServices: [MyService] |
235+
}) |
236+
@Template({ | Assume we have a template that needs to be
237+
url: 'my_app.html', | configured with directives to be injected.
238+
directives: [House] |
240239
}) |
241240
class MyApp {} |
242241
|

0 commit comments

Comments
 (0)