antjanus / angular2-ts-starter-kit Goto Github PK
View Code? Open in Web Editor NEWAngular 2.X TypeScript starter kit
Angular 2.X TypeScript starter kit
Ran into another issue when using this project.
When opening the page, I noticed this error in the console.
EXCEPTION: The selector "my-app" did not match any elements
bundle.js:433 Uncaught (in promise) TypeError: object is not a constructor(…)obj.(anonymous function) @ bundle.js:433
bundle.js:23282 Uncaught (in promise) BaseException {message: "The selector "my-app" did not match any elements", stack: "Error: The selector "my-app" did not match any ele…eBoundFn (http://localhost:3001/bundle.js:177:20)"}(anonymous function) @ bundle.js:23282run @ bundle.js:204(anonymous function) @ bundle.js:23697zoneBoundFn @ bundle.js:177
Took me some time to figure out what the issue was, but basically, the bootstrap
function was called to early.
Not sure why you did not run into this issue. Maybe something recently changed?
Anyway, there are 2 ways to solve this:
I'll create a PR for both options, I'll let you decide what you think is the best option.
(I'd prefer option 2)
When trying to use your starter kit, I ran into troubles when running gulp
to start the server:
ERROR in node_modules/angular2/src/facade/async.d.ts
(3,25): error TS2307: Cannot find module 'rxjs/Subject'.
ERROR in node_modules/angular2/src/facade/async.d.ts
(4,44): error TS2307: Cannot find module 'rxjs/Observable'.
ERROR in node_modules/angular2/src/facade/async.d.ts
(5,26): error TS2307: Cannot find module 'rxjs/Operator'.
ERROR in node_modules/angular2/src/facade/async.d.ts
(6,25): error TS2307: Cannot find module 'rxjs/Subject'.
ERROR in ./~/angular2/src/facade/async.js
Module not found: Error: Cannot resolve module 'rxjs/Subject' in /node_modules/angular2/src/facade
@ ./~/angular2/src/facade/async.js 10:16-39 14:16-39
ERROR in ./~/angular2/src/facade/async.js
Module not found: Error: Cannot resolve module 'rxjs/Observable' in /node_modules/angular2/src/facade
@ ./~/angular2/src/facade/async.js 11:19-45
I found out it could be solved by just npm installing rxjs.
I am not sure if this is because of the newer version from Angular2? Or Why I have this problem
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.