Im getting this kind of error despite of the fact i imported Component from angular2/core what should be its source is files are not downloaded through npm install or my node is needs to be upgrade
Here is my file
import {bootstrap} from 'angular2/platform/browser';
import {Component, View} from 'angular2/core';
@Component({
})
What exactly does this error indicate? The Angular version expects a typescript version between 4.0.1 and 4.1.7, but it was updated with version 4.2.0. In the application, type below command to know angular and typescript versions using this application
Angular compiler options link When you use AOT compilation, you can control how your application is compiled by specifying template compiler options in the TypeScript configuration file. The template options object, angularCompilerOptions, is a sibling to the compilerOptions object that supplies standard options to the TypeScript compiler.
The fullTemplateTypeCheck option has been deprecated in Angular 13 in favor of the strictTemplates family of compiler options. When true (the default), generates factory files ( .ngfactory.js and .ngstyle.js) for .d.ts files with a corresponding .metadata.json file. When false, factory files are generated only for .ts files.
The ngc command is just a wrapper around TypeScript's tsc compiler command and is primarily configured via the tsconfig.json configuration options documented in the previous sections. In addition to the configuration file, you can also use tsc command line options to configure ngc.
Define a class right after the component.
import {bootstrap} from 'angular2/platform/browser';
import {Component, View} from 'angular2/core';
@Component({
})
class MyClass {
}
@Component
is just a decorator that contains metadata for the class. In other words it just defines stuff for your class in a more elegant way.
The @Component function takes the configuration object and turns it into metadata that it attaches to the component class definition. Angular discovers this metadata at runtime and thus knows how to do "the right thing".
Read more here
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