File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
modules/angular2/docs/core Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff 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}) |
124123class 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}) |
241240class MyApp {} |
242241 |
You can’t perform that action at this time.
0 commit comments