Cercando di imparare angolare così ho iniziato con il tutorial quickstart per il dattiloscritto nel loro sito web (https://angular.io/guide/quickstart)angolare 2 Quickstart - componente my-app non caricare
sto lavorando su Ubuntu 14.04.
Ho seguito ogni passaggio e alla fine non ricevo errori, ma il componente non viene caricato. Invece, l'unica cosa che vedo è "Caricamento in corso ..." invece del componente principale "mia-app".
il index.html:
<html>
<head>
<title>Angular 2 QuickStart</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- 1. Load libraries -->
<!-- Polyfill(s) for older browsers -->
<script src="node_modules/core-js/client/shim.min.js"></script>
<script src="node_modules/zone.js/dist/zone.js"></script>
<script src="node_modules/reflect-metadata/Reflect.js"></script>
<script src="node_modules/systemjs/dist/system.src.js"></script>
<!-- 2. Configure SystemJS -->
<script src="systemjs.config.js"></script>
<script>
System.import('app').catch(function(err){ console.error(err); });
</script>
</head>
<!-- 3. Display the application -->
<body>
<my-app>Loading...</my-app>
</body>
</html>
app/app.component.ts:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: '<h1>My First Angular 2 App</h1>'
})
export class AppComponent { }
vedo alcun punto in mostra il resto del file di configurazione perché sono esattamente come quelli del tutorial. L'unico cambiamento è che ho cambiato tsconfig.json a
"target": "es6",
perché non ha funzionato al contrario.
Quale può essere il problema? Perché non sta caricando il mio componente principale?
Edit: questi sono gli errori nel mio console del browser:
2 http://localhost:3000/node_modules/systemjs/dist/system.src.js Failed to load resource: the server responded with a status of 404 (Not Found)
systemjs.config.js:46 Uncaught TypeError: System.config is not a function
http://localhost:3000/app/ Failed to load resource: the server responded with a status of 404 (Not Found)
app:18 Not Found: http://localhost:3000/app
Error loading http://localhost:3000/app(anonymous function) @ app:18
http://localhost:3000/app/ Failed to load resource: the server responded with a status of 404 (Not Found)
Penso che sia necessario eseguire il bootstrap dell'applicazione – juvian
Aprire la console e controllare il messaggio err – Zen
Quale ID si usa? –