Just took a look at the last angular version that the angular team launch. Angular2 is out and they have been release a their new webpage https://angular.io.
In there they have a 5 min quickstart project that shows quickly the new syntax and what you have to use to perform a new angular application.
I just did all the steps to get it working but it took 4.93 seconds to load.
I'm just wondering, is angular 2 that slow? Or maybe I miss some steps.
Here is my code
// app.es6
import { Component, Template, bootstrap } from "angular2/angular2";
// Annotation section
@Component({
selector: "my-app"
})
@Template({
inline: "<h1>Hello {{ name }}</h1>"
})
// Component controller
class MyAppComponent {
constructor() {
this.name = "Alex!";
}
}
bootstrap(MyAppComponent);
and index.html
<!-- index.html -->
<html>
<head>
<title>Angular 2 Quickstart</title>
<script src="dist/es6-shim.js"></script>
</head>
<body>
<!-- The app component created in app.js -->
<my-app></my-app>
<script>
// Rewrite the paths to load the files
System.paths = {
'angular2/*':'angular2/*.js', // Angular
'rtts_assert/*': 'rtts_assert/*.js', //Runtime assertions
'app': 'app.js' // The my-app component
};
// Kick off the application
System.import('app');
</script>
</body>
</html>
If you've done your research and figured out that your app doesn't render that much and doesn't render that often, then your code may just simply be quite slow. This is probably due to some heavy scripting and not DOM-related. Use WebWorkers. The Angular CLI also provides a command to generate a WebWorker in a snap.
Since its initial release, the AngularJS developed web applications have been comparatively slow. Almost every developer has faced performative issues with Angular.
See https://github.com/djsmith42/angular2_calendar on how to get it to run fast.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With