angular - Error loading http://localhost:4200/app/subjects.component.js as "./subjects.component" from http://localhost:4200/app/app.routes.js -
what possible meaning of these errors? uncaught referenceerror: require not defined
get http://localhost:4200/traceur 404 (not found)
potentially unhandled rejection [5] error: xhr error (404 not found) loading http://localhost:4200/traceur @ xmlhttprequest.wrapfn [as _onreadystatechange] (http://localhost:4200/vendor/zone.js/dist/zone.js:769:30) @ zonedelegate.invoketask (http://localhost:4200/vendor/zone.js/dist/zone.js:356:38) @ zone.runtask (http://localhost:4200/vendor/zone.js/dist/zone.js:256:48) @ xmlhttprequest.zonetask.invoke (http://localhost:4200/vendor/zone.js/dist/zone.js:423:34) error loading http://localhost:4200/traceur error loading http://localhost:4200/app/subjects.component.js "./subjects.component" http://localhost:4200/app/app.routes.js
here's index.html:
<!doctype html> <html> <head> <meta charset="utf-8"> <title>material2app</title> <base href="/"> {{content-for 'head'}} <link rel="icon" type="image/x-icon" href="favicon.ico"> <link href="https://fonts.googleapis.com/icon?family=material+icons" rel="stylesheet"> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <my-app>loading...</my-app> <script src="vendor/core-js/client/core.js"></script> <script src="vendor/reflect-metadata/reflect.js"></script> <script src="vendor/zone.js/dist/zone.js"></script> <script src="vendor/systemjs/dist/system-polyfills.js"></script> <script src="vendor/systemjs/dist/system.src.js"></script> <script src="vendor/@angular/http/http.js"></script> <script> system.import('system-config.js').then(function () { system.import('main'); }).catch(console.error.bind(console)); </script> </body> </html>
app.routes.ts:
import { providerouter, routerconfig } '@angular/router'; import {subjectscomponent} './subjects.component'; import {basiccardcomponent} './basiccard.component'; export const routes: routerconfig = [ { path: '', component: subjectscomponent }, ]; export const approuterproviders = [ providerouter(routes) ];
subjects.component.ts:
import {component} '@angular/core'; import {bootstrap} '@angular/platform-browser-dynamic'; import {mdbutton} '@angular2-material/button'; import {mdcard} '@angular2-material/card'; import {mdtoolbar} '@angular2-material/toolbar'; import {mdicon,mdiconregistry} '@angular2-material/icon'; import {mdtab} '@angular2-material/tabs'; import {mdinput,md_input_directives} '@angular2-material/input'; import {mdcheckbox} '@angular2-material/checkbox'; import { router_directives} '@angular/router'; import { providerouter, routerconfig } '@angular/router'; import {profiledetailscomponent} './profiledetails.component'; //import {agreementcomponent} './agreement.component'; @component({ selector: 'subjects', templateurl: 'app/subjects.component.html' , styleurls: ['app/app.component.css'], directives: [//agreementcomponent, mdbutton,mdcard,mdtoolbar,mdicon,mdinput,md_input_directives,mdcheckbox,profiledetailscomponent,router_directives], providers:[mdiconregistry] }) export class subjectscomponent{ private buttonstate: boolean = true; private classes1 = [{label: 'english', state: false},{label: 'hindi', state: false},{label: 'mathematics', state: false},{label: 'science', state: false},{label: 'computer science', state: false},{label: 'social science', state: false},{label: 'environmental studies', state: false}]; setbuttonstate() { let counter = 0; for(let i=0;i<this.classes1.length;i++) { if (this.classes1[i].state === true) { counter++; }} if (counter >= 1) { this.buttonstate = false; } else {this.buttonstate = true;} } }
bearing in mind when question asked, i'm not sure advice you. nevertheless, else receiving (and did using angular cli, while upgrading rc.5 rc.6) make following update system-config.ts:
const packages: = { 'rxjs' : {main: 'rx'}, '@angular/core' : {main: 'bundles/core.umd.min.js', format: 'cjs'}, '@angular/common' : {main: 'bundles/common.umd.min.js', format: 'cjs'}, '@angular/compiler' : {main: 'bundles/compiler.umd.min.js', format: 'cjs'}, '@angular/forms' : {main: 'bundles/forms.umd.min.js', format: 'cjs'}, '@angular/router' : {main: 'bundles/router.umd.min.js', format: 'cjs'}, '@angular/platform-browser' : {main: 'bundles/platform-browser.umd.min.js', format: 'cjs'}, '@angular/platform-browser-dynamic': {main: 'bundles/platform-browser-dynamic.umd.min.js', format: 'cjs'}, '@angular/http' : {main: 'bundles/http.umd.min.js'}, };
Comments
Post a Comment