質問編集履歴

1

情報の追記

2021/08/22 08:23

投稿

tonkotsu_ramen
tonkotsu_ramen

スコア6

test CHANGED
File without changes
test CHANGED
@@ -311,3 +311,187 @@
311
311
  </form>
312
312
 
313
313
  ```
314
+
315
+
316
+
317
+
318
+
319
+ ```typescript
320
+
321
+ // app.module.ts
322
+
323
+ import { NgModule } from '@angular/core';
324
+
325
+ import { BrowserModule } from '@angular/platform-browser';
326
+
327
+ import { RouterModule, Routes } from '@angular/router';
328
+
329
+ import {
330
+
331
+ FormsModule,
332
+
333
+ ReactiveFormsModule,
334
+
335
+ FormGroup,
336
+
337
+ FormBuilder,
338
+
339
+ Validators,
340
+
341
+ } from '@angular/forms';
342
+
343
+
344
+
345
+ import { AppRoutingModule } from './app-routing.module';
346
+
347
+ import { AppComponent } from './app.component';
348
+
349
+ import { TestComponent } from './test/test.component';
350
+
351
+ import { LoginComponent } from './login/login.component';
352
+
353
+ import { MypageComponent } from './mypage/mypage.component';
354
+
355
+ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
356
+
357
+ import { MatSliderModule } from '@angular/material/slider';
358
+
359
+ import { MatButtonModule } from '@angular/material/button';
360
+
361
+ import { MatCardModule } from '@angular/material/card';
362
+
363
+ import { MatInputModule } from '@angular/material/input';
364
+
365
+ import { MatFormFieldModule } from '@angular/material/form-field';
366
+
367
+ import { MatIconModule } from '@angular/material/icon';
368
+
369
+
370
+
371
+ const ROUTE_TABLE: Routes = [
372
+
373
+ { path: 'test', component: TestComponent },
374
+
375
+ { path: 'login', component: LoginComponent },
376
+
377
+ { path: 'mypage', component: MypageComponent },
378
+
379
+ ];
380
+
381
+
382
+
383
+ @NgModule({
384
+
385
+ declarations: [AppComponent, TestComponent, LoginComponent, MypageComponent],
386
+
387
+ imports: [
388
+
389
+ BrowserModule,
390
+
391
+ AppRoutingModule,
392
+
393
+ FormsModule,
394
+
395
+ ReactiveFormsModule,
396
+
397
+ RouterModule.forRoot(ROUTE_TABLE),
398
+
399
+ BrowserAnimationsModule,
400
+
401
+ MatSliderModule,
402
+
403
+ MatButtonModule,
404
+
405
+ MatCardModule,
406
+
407
+ MatInputModule,
408
+
409
+ MatFormFieldModule,
410
+
411
+ MatIconModule,
412
+
413
+ FormGroup,
414
+
415
+ FormBuilder,
416
+
417
+ Validators,
418
+
419
+ ],
420
+
421
+ providers: [],
422
+
423
+ bootstrap: [AppComponent],
424
+
425
+ })
426
+
427
+ export class AppModule {}
428
+
429
+
430
+
431
+ ```
432
+
433
+
434
+
435
+ ```typescript
436
+
437
+ // registration-routing.module.ts
438
+
439
+ import { NgModule } from '@angular/core';
440
+
441
+ import { RouterModule, Routes } from '@angular/router';
442
+
443
+ import { RegistrationComponent } from './registration.component';
444
+
445
+
446
+
447
+ const routes: Routes = [{ path: '', component: RegistrationComponent }];
448
+
449
+
450
+
451
+ @NgModule({
452
+
453
+ imports: [RouterModule.forChild(routes)],
454
+
455
+ exports: [RouterModule],
456
+
457
+ })
458
+
459
+ export class RegistrationRoutingModule {}
460
+
461
+
462
+
463
+ ```
464
+
465
+
466
+
467
+ ```typescript
468
+
469
+ // registration.module.ts
470
+
471
+ import { NgModule } from '@angular/core';
472
+
473
+ import { CommonModule } from '@angular/common';
474
+
475
+ import { FormBuilder, FormGroup } from '@angular/forms';
476
+
477
+
478
+
479
+ import { RegistrationRoutingModule } from './registration-routing.module';
480
+
481
+ import { RegistrationComponent } from './registration.component';
482
+
483
+
484
+
485
+ @NgModule({
486
+
487
+ declarations: [RegistrationComponent],
488
+
489
+ imports: [CommonModule, RegistrationRoutingModule, FormBuilder, FormGroup],
490
+
491
+ })
492
+
493
+ export class RegistrationModule {}
494
+
495
+
496
+
497
+ ```