I am a complete newbie in web development, and I am completely lost.
I have downloaded the Angular Quickstart used in the Angular tutorial (https://github.com/angular/quickstart) and now I want to insert a simple x3d element. To do so, I have modified the files app.module.ts
, app.component.ts
and index.html
.
The modified file app.module.ts
is:
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';`
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
@NgModule({
imports: [ BrowserModule ],
declarations: [ AppComponent ],
schemas: [ NO_ERRORS_SCHEMA ],
bootstrap: [ AppComponent ]
})
export class AppModule { }
The new app.component.ts
that I have created is:
import { Component } from '@angular/core';
@Component({
selector: 'my-app',
template: `<x3d width='600px' height='400px'>
<scene>
<shape>
<appearance>
<material diffuseColor='1 0 0'></material>
</appearance>
<box></box>
</shape>
</scene>
</x3d>`,
})
export class AppComponent { name = 'Angular'; }
And finally, the new index.html
looks like that:
<!DOCTYPE html>
<html>
<head>
<title>Angular QuickStart</title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="styles.css">
<!-- 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/systemjs/dist/system.src.js"></script>
<script type='text/javascript' src='http://www.x3dom.org/download/x3dom.js'> </script>
<script src="systemjs.config.js"></script>
<script>
System.import('main.js').catch(function(err){ console.error(err); });
</script>
</head>
<body>
<my-app>Loading AppComponent content here ...</my-app>
</body>
</html>
When I run $ npm start
, nothing is shown, and the browser does not raise any errors, and I cannot figure out why. I am using Angular 4. Any help to solve this issue would be appreciated, thanks.