1
1
import { Component , ChangeDetectionStrategy , ViewEncapsulation , Type } from 'angular2/core' ;
2
- import { IONIC_DIRECTIVES } from '../config/directives' ;
3
2
4
3
const _reflect : any = Reflect ;
5
4
@@ -33,12 +32,15 @@ export interface PageMetadata {
33
32
* @description
34
33
*
35
34
* The Page decorator indicates that the decorated class is an Ionic
36
- * navigation component, meaning it can be navigated to using a NavController.
35
+ * navigation component, meaning it can be navigated to using a
36
+ * [NavController](../../nav/NavController).
37
37
*
38
- * Pages have all `IONIC_DIRECTIVES`, which include all Ionic components and directives,
39
- * as well as Angular's [CORE_DIRECTIVES](https://angular.io/docs/js/latest/api/core/CORE_DIRECTIVES-const.html)
40
- * and [FORM_DIRECTIVES](https://angular.io/docs/js/latest/api/core/FORM_DIRECTIVES-const.html),
41
- * already provided to them, so you only need to supply custom components and directives to your pages:
38
+ * Since the app has already been bootstrapped with Ionic's core directives, it
39
+ * is not needed to include `IONIC_DIRECTIVES` in the directives property. Additionally,
40
+ * Angular's [CORE_DIRECTIVES](https://angular.io/docs/ts/latest/api/common/CORE_DIRECTIVES-let.html)
41
+ * and [FORM_DIRECTIVES](https://angular.io/docs/ts/latest/api/common/FORM_DIRECTIVES-let.html),
42
+ * are also already provided, so you only need to supply any custom components and directives
43
+ * to your pages:
42
44
*
43
45
* @usage
44
46
*
@@ -53,44 +55,7 @@ export interface PageMetadata {
53
55
* class MyPage {}
54
56
* ```
55
57
*
56
- * Here [Content](../../../components/content/Content/) will load because
57
- * it is in `IONIC_DIRECTIVES`, so there is no need to add a `directives` array.
58
- *
59
- *
60
- * Say you built a custom component that uses the already existing Ionic component.
61
- * In this case, you would add `IONIC_DIRECTIVES` to your directives array.
62
- *
63
- * ```ts
64
- * import {IONIC_DIRECTIVES} from 'ionic-angular';
65
- * @Component ({
66
- * selector: 'my-component'
67
- * template: `<div class="my-style">
68
- * <ion-checkbox></ion-checkbox>
69
- * </div>`,
70
- * directives: [IONIC_DIRECTIVES]
71
- * })
72
- * class MyCustomCheckbox {}
73
- *```
74
-
75
- * Alternatively, you could:
76
- *
77
- * ```ts
78
- * import {Checkbox, Icon} from 'ionic-angular'
79
- * ```
80
- *
81
- * along with any other components and add them individually:
82
- *
83
- * ```
84
- * @Component ({
85
- * ...
86
- * directives: [Checkbox, Icon]
87
- * })
88
- * ```
89
- *
90
- * However, using IONIC_DIRECTIVES will always *Just Work* with no
91
- * performance overhead, so there is really no reason to not always use it.
92
- *
93
- * Pages have their content automatically wrapped in `<ion-view>`, so although
58
+ * Pages have their content automatically wrapped in `<ion-page>`, so although
94
59
* you may see these tags if you inspect your markup, you don't need to include
95
60
* them in your templates.
96
61
*
@@ -99,7 +64,6 @@ export interface PageMetadata {
99
64
export function Page ( config : PageMetadata ) {
100
65
return function ( cls ) {
101
66
config . selector = 'ion-page' ;
102
- config . directives = config . directives ? config . directives . concat ( IONIC_DIRECTIVES ) : IONIC_DIRECTIVES ;
103
67
config . host = config . host || { } ;
104
68
config . host [ '[hidden]' ] = '_hidden' ;
105
69
config . host [ '[class.tab-subpage]' ] = '_tabSubPage' ;
0 commit comments