Hello, was wondering if you can help me with an error i am getting on my ionic 2 app. the following is the error:
Error
Close
Runtime Error
Error in ./HomePage class HomePage - caused by: Cannot read property 'title' of undefined
Stack
TypeError: Cannot read property 'title' of undefined
at CompiledTemplate.proxyViewClass.View_HomePage0.detectChangesInternal (/AppModule/HomePage/component.ngfactory.js:58:113)
at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:8100/build/main.js:136111:14)
at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:8100/build/main.js:136306:44)
at CompiledTemplate.proxyViewClass.AppView.internalDetectChanges (http://localhost:8100/build/main.js:136096:18)
at CompiledTemplate.proxyViewClass.View_HomePage_Host0.detectChangesInternal (/AppModule/HomePage/host.ngfactory.js:29:19)
at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:8100/build/main.js:136111:14)
at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:8100/build/main.js:136306:44)
at ViewRef_.detectChanges (http://localhost:8100/build/main.js:79470:20)
at NavControllerBase._viewAttachToDOM (http://localhost:8100/build/main.js:44598:40)
at NavControllerBase._transitionInit (http://localhost:8100/build/main.js:44701:18)
at NavControllerBase._postViewInit (http://localhost:8100/build/main.js:44554:14)
at NavControllerBase._queueTrns (http://localhost:8100/build/main.js:44343:14)
at Nav.ngAfterViewInit (http://localhost:8100/build/main.js:61774:18)
at CompiledTemplate.proxyViewClass.View_MyApp0.detectChangesInternal (/AppModule/MyApp/component.ngfactory.js:55:62)
at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:8100/build/main.js:136111:14)
Ionic Framework: 2.2.0
Ionic Native: 2.8.1
Ionic App Scripts: 1.1.4
Angular Core: 2.4.8
Angular Compiler CLI: 2.4.8
Node: 7.7.3
OS Platform: Windows 10
Navigator Platform: Win32
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.87 Safari/537.36
this is the code i have on my home.html
<ion-content>
<pre>{{quiz.title | json}}</pre>
</ion-content>
The weird thing is that it works when i do this in home.html
<ion-content>
<pre>{{quiz.title | json}}</pre>
</ion-content>
I hope someday i am able to figure this error out
UPDATE: 5/15/17 - I THINK I FIGURE THIS ERROR OUT
i had this in the response.html template:<pre>QuizResults {{QuizResults.Response |json}}</pre>
In the response.ts i had QuizResults initialized as:QuizResults:any;
when i ran the script, i would see this error: Runtime Error Error in ./ResultsPage class ResultsPage - caused by: Cannot read property 'Response' of undefined
FIX: to fix this error, go to response.ts and change
QuizResults:any
TO:
QuizResults={};
Hope that explains a little bit of whats going on here
maybe this is something to read about:
http://stackoverflow.com/questions/34734671/observable-type-error-cannot-read-property-of-undefined