Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBryant Feld
Full Stack JavaScript Techdegree Student 26,144 Pointshelp with angular 2
with this code...
`import { Component} from "@angular/core";
export class AppComponent ({ selector: 'app-root', template: '<h2> Hello World! </h2>', styles: [ 'h2 { font-family: sans-serif; font-size: 1.2em; }' ], });`
I am getting these errors,
compiler.umd.js?5ddf:18666 Uncaught SyntaxError {nativeError: Error: Unexpected value 'AppComponent' declared by the module 'AppModule' at SyntaxError.BaseErrβ¦} CompileMetadataResolver._reportError @ compiler.umd.js?5ddf:18666 (anonymous) @ compiler.umd.js?5ddf:18169 CompileMetadataResolver.getNgModuleMetadata @ compiler.umd.js?5ddf:18151 JitCompiler._loadModules @ compiler.umd.js?5ddf:27308 JitCompiler._compileModuleAndComponents @ compiler.umd.js?5ddf:27268 JitCompiler.compileModuleAsync @ compiler.umd.js?5ddf:27234 PlatformRef.bootstrapModuleWithZone @ core.umd.js?0085:8477 PlatformRef.bootstrapModule @ core.umd.js?0085:8452 (anonymous) @ main.ts?b04d:5 75 @ app.3540dda49706fd087eb1.js:15 webpack_require @ polyfills.3540dda49706fd087eb1.js:51 0 @ app.3540dda49706fd087eb1.js:7 webpack_require @ polyfills.3540dda49706fd087eb1.js:51 webpackJsonpCallback @ polyfills.3540dda49706fd087eb1.js:22 (anonymous) @ app.3540dda49706fd087eb1.js:1 client?c7c8:37 [WDS] Errors while compiling. client?c7c8:75 [at-loader] src\app\app.component.ts:3:27 '{' expected.
also the quotes around the styles string were not present in the tutorial, I found out that was wrong by looking it up and added them. Which begs the question is the code that is shown in the videos actually what is running when results are shown are does editing prevent this from being the case thanks!
repo is here > https://github.com/bkfwebdev/photoblog