1 |
|
2 |
|
3 |
|
4 | import { ANALYZE_FOR_ENTRY_COMPONENTS, APP_INITIALIZER, ComponentFactoryResolver, Inject, Injector, NgModule, NgZone, Optional } from '@angular/core';
|
5 | import { APP_BASE_HREF, HashLocationStrategy, Location, LocationStrategy, PathLocationStrategy, PlatformLocation } from '@angular/common';
|
6 | import { DOCUMENT, HAMMER_GESTURE_CONFIG } from '@angular/platform-browser';
|
7 | import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
8 | import { CommonModule } from '@angular/common';
|
9 |
|
10 |
|
11 |
|
12 | import { App } from './components/app/app';
|
13 | import { AppRootToken } from './components/app/app-root';
|
14 | import { Config, ConfigToken, setupConfig } from './config/config';
|
15 | import { DeepLinker, setupDeepLinker } from './navigation/deep-linker';
|
16 | import { DomController } from './platform/dom-controller';
|
17 | import { Events, setupProvideEvents } from './util/events';
|
18 | import { Form } from './util/form';
|
19 | import { GestureController } from './gestures/gesture-controller';
|
20 | import { IonicGestureConfig } from './gestures/gesture-config';
|
21 | import { Haptic } from './tap-click/haptic';
|
22 | import { Keyboard } from './platform/keyboard';
|
23 | import { LAZY_LOADED_TOKEN, ModuleLoader, provideModuleLoader, setupPreloading } from './util/module-loader';
|
24 | import { NgModuleLoader } from './util/ng-module-loader';
|
25 | import { Platform, setupPlatform } from './platform/platform';
|
26 | import { PlatformConfigToken, providePlatformConfigs } from './platform/platform-registry';
|
27 | import { TapClick, setupTapClick } from './tap-click/tap-click';
|
28 | import { registerModeConfigs } from './config/mode-registry';
|
29 | import { TransitionController } from './transitions/transition-controller';
|
30 | import { DeepLinkConfigToken, UrlSerializer, setupUrlSerializer } from './navigation/url-serializer';
|
31 |
|
32 |
|
33 |
|
34 | import { ActionSheetCmp } from './components/action-sheet/action-sheet-component';
|
35 | import { ActionSheetController } from './components/action-sheet/action-sheet-controller';
|
36 | import { AlertCmp } from './components/alert/alert-component';
|
37 | import { AlertController } from './components/alert/alert-controller';
|
38 | import { ClickBlock } from './components/app/click-block';
|
39 | import { IonicApp } from './components/app/app-root';
|
40 | import { OverlayPortal } from './components/app/overlay-portal';
|
41 | import { Avatar } from './components/avatar/avatar';
|
42 | import { Backdrop } from './components/backdrop/backdrop';
|
43 | import { Badge } from './components/badge/badge';
|
44 | import { Button } from './components/button/button';
|
45 | import { Card } from './components/card/card';
|
46 | import { CardContent } from './components/card/card-content';
|
47 | import { CardHeader } from './components/card/card-header';
|
48 | import { CardTitle } from './components/card/card-title';
|
49 | import { Checkbox } from './components/checkbox/checkbox';
|
50 | import { Chip } from './components/chip/chip';
|
51 | import { Content } from './components/content/content';
|
52 | import { DateTime } from './components/datetime/datetime';
|
53 | import { FabButton } from './components/fab/fab';
|
54 | import { FabContainer } from './components/fab/fab-container';
|
55 | import { FabList } from './components/fab/fab-list';
|
56 | import { Col } from './components/grid/col';
|
57 | import { Grid } from './components/grid/grid';
|
58 | import { Row } from './components/grid/row';
|
59 | import { Icon } from './components/icon/icon';
|
60 | import { Img } from './components/img/img';
|
61 | import { InfiniteScroll } from './components/infinite-scroll/infinite-scroll';
|
62 | import { InfiniteScrollContent } from './components/infinite-scroll/infinite-scroll-content';
|
63 | import { TextInput } from './components/input/input';
|
64 | import { Item } from './components/item/item';
|
65 | import { ItemContent } from './components/item/item-content';
|
66 | import { ItemDivider } from './components/item/item-divider';
|
67 | import { ItemGroup } from './components/item/item-group';
|
68 | import { ItemOptions } from './components/item/item-options';
|
69 | import { ItemReorder } from './components/item/item-reorder';
|
70 | import { ItemSliding } from './components/item/item-sliding';
|
71 | import { Reorder } from './components/item/reorder';
|
72 | import { Label } from './components/label/label';
|
73 | import { List } from './components/list/list';
|
74 | import { ListHeader } from './components/list/list-header';
|
75 | import { LoadingCmp } from './components/loading/loading-component';
|
76 | import { LoadingController } from './components/loading/loading-controller';
|
77 | import { Menu } from './components/menu/menu';
|
78 | import { MenuClose } from './components/menu/menu-close';
|
79 | import { MenuController } from './components/app/menu-controller';
|
80 | import { MenuToggle } from './components/menu/menu-toggle';
|
81 | import { ModalCmp } from './components/modal/modal-component';
|
82 | import { ModalController } from './components/modal/modal-controller';
|
83 | import { Nav } from './components/nav/nav';
|
84 | import { NavPop } from './components/nav/nav-pop';
|
85 | import { NavPopAnchor } from './components/nav/nav-pop-anchor';
|
86 | import { NavPush } from './components/nav/nav-push';
|
87 | import { NavPushAnchor } from './components/nav/nav-push-anchor';
|
88 | import { Note } from './components/note/note';
|
89 | import { Option } from './components/option/option';
|
90 | import { PickerCmp } from './components/picker/picker-component';
|
91 | import { PickerColumnCmp } from './components/picker/picker-column';
|
92 | import { PickerController } from './components/picker/picker-controller';
|
93 | import { PopoverCmp } from './components/popover/popover-component';
|
94 | import { PopoverController } from './components/popover/popover-controller';
|
95 | import { RadioButton } from './components/radio/radio-button';
|
96 | import { RadioGroup } from './components/radio/radio-group';
|
97 | import { Range } from './components/range/range';
|
98 | import { RangeKnob } from './components/range/range-knob';
|
99 | import { Refresher } from './components/refresher/refresher';
|
100 | import { RefresherContent } from './components/refresher/refresher-content';
|
101 | import { Scroll } from './components/scroll/scroll';
|
102 | import { Searchbar } from './components/searchbar/searchbar';
|
103 | import { Segment } from './components/segment/segment';
|
104 | import { Select } from './components/select/select';
|
105 | import { SelectPopover } from './components/select/select-popover-component';
|
106 | import { SegmentButton } from './components/segment/segment-button';
|
107 | import { ShowWhen } from './components/show-hide-when/show-when';
|
108 | import { HideWhen } from './components/show-hide-when/hide-when';
|
109 | import { Slide } from './components/slides/slide';
|
110 | import { Slides } from './components/slides/slides';
|
111 | import { Spinner } from './components/spinner/spinner';
|
112 | import { SplitPane } from './components/split-pane/split-pane';
|
113 | import { Tab } from './components/tabs/tab';
|
114 | import { TabButton } from './components/tabs/tab-button';
|
115 | import { TabHighlight } from './components/tabs/tab-highlight';
|
116 | import { Tabs } from './components/tabs/tabs';
|
117 | import { Thumbnail } from './components/thumbnail/thumbnail';
|
118 | import { ToastCmp } from './components/toast/toast-component';
|
119 | import { ToastController } from './components/toast/toast-controller';
|
120 | import { Toggle } from './components/toggle/toggle';
|
121 | import { Footer } from './components/toolbar/toolbar-footer';
|
122 | import { Header } from './components/toolbar/toolbar-header';
|
123 | import { Toolbar } from './components/toolbar/toolbar';
|
124 | import { ToolbarItem } from './components/toolbar/toolbar-item';
|
125 | import { ToolbarTitle } from './components/toolbar/toolbar-title';
|
126 | import { Navbar } from './components/toolbar/navbar';
|
127 | import { Typography } from './components/typography/typography';
|
128 | import { VirtualFooter } from './components/virtual-scroll/virtual-footer';
|
129 | import { VirtualHeader } from './components/virtual-scroll/virtual-header';
|
130 | import { VirtualItem } from './components/virtual-scroll/virtual-item';
|
131 | import { VirtualScroll } from './components/virtual-scroll/virtual-scroll';
|
132 |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|
139 |
|
140 |
|
141 |
|
142 |
|
143 |
|
144 |
|
145 |
|
146 |
|
147 |
|
148 |
|
149 |
|
150 |
|
151 |
|
152 |
|
153 |
|
154 |
|
155 |
|
156 |
|
157 |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 |
|
163 |
|
164 |
|
165 |
|
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 | export class IonicModule {
|
173 | |
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 | static forRoot(appRoot, config = null, deepLinkConfig = null) {
|
180 | return {
|
181 | ngModule: IonicModule,
|
182 | providers: [
|
183 |
|
184 | { provide: AppRootToken, useValue: appRoot },
|
185 | { provide: ConfigToken, useValue: config },
|
186 | { provide: DeepLinkConfigToken, useValue: deepLinkConfig },
|
187 | { provide: APP_BASE_HREF, useValue: '/' },
|
188 |
|
189 | { provide: PlatformConfigToken, useFactory: providePlatformConfigs },
|
190 |
|
191 | { provide: Platform, useFactory: setupPlatform, deps: [DOCUMENT, PlatformConfigToken, NgZone] },
|
192 | { provide: Config, useFactory: setupConfig, deps: [ConfigToken, Platform] },
|
193 |
|
194 | { provide: APP_INITIALIZER, useFactory: registerModeConfigs, deps: [Config], multi: true },
|
195 | { provide: APP_INITIALIZER, useFactory: setupProvideEvents, deps: [Platform, DomController], multi: true },
|
196 | { provide: APP_INITIALIZER, useFactory: setupTapClick, deps: [Config, Platform, DomController, App, GestureController], multi: true },
|
197 | { provide: APP_INITIALIZER, useFactory: setupPreloading, deps: [Config, DeepLinkConfigToken, ModuleLoader, NgZone], multi: true },
|
198 |
|
199 | { provide: HAMMER_GESTURE_CONFIG, useClass: IonicGestureConfig },
|
200 |
|
201 | { provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: appRoot, multi: true },
|
202 |
|
203 | ActionSheetController,
|
204 | AlertController,
|
205 | App,
|
206 | DomController,
|
207 | Events,
|
208 | Form,
|
209 | GestureController,
|
210 | Haptic,
|
211 | Keyboard,
|
212 | LoadingController,
|
213 | Location,
|
214 | MenuController,
|
215 | ModalController,
|
216 | NgModuleLoader,
|
217 | PickerController,
|
218 | PopoverController,
|
219 | TapClick,
|
220 | ToastController,
|
221 | TransitionController,
|
222 | { provide: ModuleLoader, useFactory: provideModuleLoader, deps: [NgModuleLoader, Injector] },
|
223 | { provide: LocationStrategy, useFactory: provideLocationStrategy, deps: [PlatformLocation, [new Inject(APP_BASE_HREF), new Optional()], Config] },
|
224 | { provide: UrlSerializer, useFactory: setupUrlSerializer, deps: [App, DeepLinkConfigToken] },
|
225 | { provide: DeepLinker, useFactory: setupDeepLinker, deps: [App, UrlSerializer, Location, ModuleLoader, ComponentFactoryResolver] },
|
226 | ]
|
227 | };
|
228 | }
|
229 | }
|
230 | IonicModule.decorators = [
|
231 | { type: NgModule, args: [{
|
232 | declarations: [
|
233 | ActionSheetCmp,
|
234 | AlertCmp,
|
235 | ClickBlock,
|
236 | IonicApp,
|
237 | OverlayPortal,
|
238 | Avatar,
|
239 | Backdrop,
|
240 | Badge,
|
241 | Button,
|
242 | Card,
|
243 | CardContent,
|
244 | CardHeader,
|
245 | CardTitle,
|
246 | Checkbox,
|
247 | Chip,
|
248 | Col,
|
249 | Content,
|
250 | DateTime,
|
251 | FabButton,
|
252 | FabContainer,
|
253 | FabList,
|
254 | Grid,
|
255 | Img,
|
256 | Icon,
|
257 | InfiniteScroll,
|
258 | InfiniteScrollContent,
|
259 | Item,
|
260 | ItemContent,
|
261 | ItemDivider,
|
262 | ItemGroup,
|
263 | ItemOptions,
|
264 | ItemReorder,
|
265 | ItemSliding,
|
266 | Label,
|
267 | List,
|
268 | ListHeader,
|
269 | Reorder,
|
270 | LoadingCmp,
|
271 | Menu,
|
272 | MenuClose,
|
273 | MenuToggle,
|
274 | ModalCmp,
|
275 | Nav,
|
276 | NavPop,
|
277 | NavPopAnchor,
|
278 | NavPush,
|
279 | NavPushAnchor,
|
280 | Note,
|
281 | Option,
|
282 | PickerCmp,
|
283 | PickerColumnCmp,
|
284 | PopoverCmp,
|
285 | RadioButton,
|
286 | RadioGroup,
|
287 | Range,
|
288 | RangeKnob,
|
289 | Refresher,
|
290 | RefresherContent,
|
291 | Row,
|
292 | Scroll,
|
293 | Searchbar,
|
294 | Segment,
|
295 | SegmentButton,
|
296 | Select,
|
297 | SelectPopover,
|
298 | ShowWhen,
|
299 | HideWhen,
|
300 | Slide,
|
301 | Slides,
|
302 | Spinner,
|
303 | SplitPane,
|
304 | Tab,
|
305 | TabButton,
|
306 | TabHighlight,
|
307 | Tabs,
|
308 | TextInput,
|
309 | Thumbnail,
|
310 | ToastCmp,
|
311 | Toggle,
|
312 | Footer,
|
313 | Header,
|
314 | Toolbar,
|
315 | ToolbarItem,
|
316 | ToolbarTitle,
|
317 | Navbar,
|
318 | Typography,
|
319 | VirtualFooter,
|
320 | VirtualHeader,
|
321 | VirtualItem,
|
322 | VirtualScroll
|
323 | ],
|
324 | imports: [
|
325 | CommonModule,
|
326 | FormsModule,
|
327 | ReactiveFormsModule,
|
328 | ],
|
329 | exports: [
|
330 | CommonModule,
|
331 | FormsModule,
|
332 | ReactiveFormsModule,
|
333 | ActionSheetCmp,
|
334 | AlertCmp,
|
335 | ClickBlock,
|
336 | IonicApp,
|
337 | OverlayPortal,
|
338 | Avatar,
|
339 | Backdrop,
|
340 | Badge,
|
341 | Button,
|
342 | Card,
|
343 | CardContent,
|
344 | CardHeader,
|
345 | CardTitle,
|
346 | Checkbox,
|
347 | Chip,
|
348 | Col,
|
349 | Content,
|
350 | DateTime,
|
351 | FabButton,
|
352 | FabContainer,
|
353 | FabList,
|
354 | Grid,
|
355 | Img,
|
356 | Icon,
|
357 | InfiniteScroll,
|
358 | InfiniteScrollContent,
|
359 | Item,
|
360 | ItemContent,
|
361 | ItemDivider,
|
362 | ItemGroup,
|
363 | ItemOptions,
|
364 | ItemReorder,
|
365 | ItemSliding,
|
366 | Label,
|
367 | List,
|
368 | ListHeader,
|
369 | Reorder,
|
370 | LoadingCmp,
|
371 | Menu,
|
372 | MenuClose,
|
373 | MenuToggle,
|
374 | ModalCmp,
|
375 | Nav,
|
376 | NavPop,
|
377 | NavPopAnchor,
|
378 | NavPush,
|
379 | NavPushAnchor,
|
380 | Note,
|
381 | Option,
|
382 | PickerCmp,
|
383 | PickerColumnCmp,
|
384 | PopoverCmp,
|
385 | RadioButton,
|
386 | RadioGroup,
|
387 | Range,
|
388 | RangeKnob,
|
389 | Refresher,
|
390 | RefresherContent,
|
391 | Row,
|
392 | Scroll,
|
393 | Searchbar,
|
394 | Segment,
|
395 | SegmentButton,
|
396 | Select,
|
397 | SelectPopover,
|
398 | ShowWhen,
|
399 | HideWhen,
|
400 | Slide,
|
401 | Slides,
|
402 | Spinner,
|
403 | SplitPane,
|
404 | Tab,
|
405 | TabButton,
|
406 | TabHighlight,
|
407 | Tabs,
|
408 | TextInput,
|
409 | Thumbnail,
|
410 | ToastCmp,
|
411 | Toggle,
|
412 | Footer,
|
413 | Header,
|
414 | Toolbar,
|
415 | ToolbarItem,
|
416 | ToolbarTitle,
|
417 | Navbar,
|
418 | Typography,
|
419 | VirtualFooter,
|
420 | VirtualHeader,
|
421 | VirtualItem,
|
422 | VirtualScroll
|
423 | ],
|
424 | entryComponents: [
|
425 | ActionSheetCmp,
|
426 | AlertCmp,
|
427 | IonicApp,
|
428 | LoadingCmp,
|
429 | ModalCmp,
|
430 | PickerCmp,
|
431 | PopoverCmp,
|
432 | SelectPopover,
|
433 | ToastCmp
|
434 | ]
|
435 | },] },
|
436 | ];
|
437 |
|
438 | IonicModule.ctorParameters = () => [];
|
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 |
|
446 |
|
447 |
|
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 |
|
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 | export class IonicPageModule {
|
468 | static forChild(page) {
|
469 | return {
|
470 | ngModule: IonicPageModule,
|
471 | providers: [
|
472 | { provide: LAZY_LOADED_TOKEN, useValue: page },
|
473 | { provide: ANALYZE_FOR_ENTRY_COMPONENTS, useValue: page, multi: true },
|
474 | ]
|
475 | };
|
476 | }
|
477 | }
|
478 | IonicPageModule.decorators = [
|
479 | { type: NgModule, args: [{
|
480 | imports: [IonicModule],
|
481 | exports: [IonicModule]
|
482 | },] },
|
483 | ];
|
484 |
|
485 | IonicPageModule.ctorParameters = () => [];
|
486 |
|
487 |
|
488 |
|
489 | export function provideLocationStrategy(platformLocationStrategy, baseHref, config) {
|
490 | return config.get('locationStrategy') === 'path' ?
|
491 | new PathLocationStrategy(platformLocationStrategy, baseHref) :
|
492 | new HashLocationStrategy(platformLocationStrategy, baseHref);
|
493 | }
|
494 |
|
\ | No newline at end of file |