実現したいこと
angularでWebApplicationを作っており、constructorの引数を増やしたいです。
現在ページは正しく表示されているのですが、コンストラクタの引数を増やすとページが表示されなくなります。
エラーはでていません。
初心者なので、どこを確認したらいいのかもわからないので、原因が分かる方がいらっしゃいましたらご助力いただけますと幸いです。
発生している問題・エラーメッセージ
なし
該当のソースコード
JavaScript
1@Component({ 2 selector: 'app-test', 3 templateUrl: '../template/test.component.html', 4 styleUrls: ['../template/test.component.css'], 5}) 6export class TestComponent implements OnInit { 7 private _testForm: FormGroup; 8 private _testModel: Model[]; 9 private _settings: Object; 10 private _questions: any[]; 11 @ViewChild('list') list: ElementRef; 12 private _element: Element; 13 private _scrollPosition: number; 14 15 constructor(private testUtil: TestUtilSevice, 16 private fb: FormBuilder, 17 private testService: TestService, 18 private router: Router) { 19 this._settings = fp02ListService.getTableSetting(); 20 this._searchForm = this.fb.group({ 21 'keyword': [''] 22 }); 23 } 24 25 ngOnInit() { 26 //以下略 27
試したこと
constructorにFormBuilder追加した場合は正しく表示されますが、string追加した場合は表示されなくなります。
constructor(private test: FormBuilder, //これはOK private testUtil: TestUtilSevice, private fb: FormBuilder, private testService: TestService, private router: Router)
constructor(private test: String, //これだとNG private testUtil: TestUtilSevice, private fb: FormBuilder, private testService: TestService, private router: Router)
バージョン
Angular 5.1.2
###やりたいこと追記
実際に増やしたいのは自作のServiceになります。
その中ではFormGroupを使って、リストを作成しています。
そのリストを画面に表示したいです。
ヒントなどでもありましたら教えていただきたいです。
よろしくお願いいたします。

回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/08/03 05:37
2018/08/03 06:37 編集
2018/08/03 07:49