Getting Uncaught Error when edit first app installed by angluar 4 - angular/cli -


i installed angular/cli first time , edit name variable in app.component.ts file , change html file below.

app.component.html:

<input type="text" [(ngmodel)]="name"> <p>{{ name }}</p> 

app.component.ts:

import { component } '@angular/core';  @component({   selector: 'app-root',   templateurl: './app.component.html',   styleurls: ['./app.component.css'] }) export class appcomponent {   name = 'text'; } 

getting error:

uncaught error: template parse errors: can't bind 'ngmodel' since isn't known property of 'input'. ("][(ngmodel)]="name"> 

{{ name }}

"): ng:///appmodule/appcomponent.html@0:19 @ syntaxerror (http://localhost:4200/vendor.bundle.js:17734:34) @ templateparser.webpackjsonp.../../../compiler/@angular/compiler.es5.js.templateparser.parse (http://localhost:4200/vendor.bundle.js:28854:19) @ jitcompiler.webpackjsonp.../../../compiler/@angular/compiler.es5.js.jitcompiler._compiletemplate (http://localhost:4200/vendor.bundle.js:43006:39) @ http://localhost:4200/vendor.bundle.js:42926:62 @ set.foreach (native) @ jitcompiler.webpackjsonp.../../../compiler/@angular/compiler.es5.js.jitcompiler._compilecomponents (http://localhost:4200/vendor.bundle.js:42926:19) @ http://localhost:4200/vendor.bundle.js:42813:19 @ object.then (http://localhost:4200/vendor.bundle.js:17723:143) @ jitcompiler.webpackjsonp.../../../compiler/@angular/compiler.es5.js.jitcompiler._compilemoduleandcomponents (http://localhost:4200/vendor.bundle.js:42812:26) @ jitcompiler.webpackjsonp.../../../compiler/@angular/compiler.es5.js.jitcompiler.compilemoduleasync (http://localhost:4200/vendor.bundle.js:42741:37) syntaxerror @ compiler.es5.js:1690 webpackjsonp.../../../compiler/@angular/compiler.es5.js.templateparser.parse @ compiler.es5.js:12810 webpackjsonp.../../../compiler/@angular/compiler.es5.js.jitcompiler._compiletemplate @ compiler.es5.js:26962 (anonymous) @ compiler.es5.js:26882 webpackjsonp.../../../compiler/@angular/compiler.es5.js.jitcompiler._compilecomponents @ compiler.es5.js:26882 (anonymous) @ compiler.es5.js:26769 @ compiler.es5.js:1679 webpackjsonp.../../../compiler/@angular/compiler.es5.js.jitcompiler._compilemoduleandcomponents @ compiler.es5.js:26768 webpackjsonp.../../../compiler/@angular/compiler.es5.js.jitcompiler.compilemoduleasync @ compiler.es5.js:26697 webpackjsonp.../../../core/@angular/core.es5.js.platformref_._bootstrapmodulewithzone @ core.es5.js:4536 webpackjsonp.../../../core/@angular/core.es5.js.platformref_.bootstrapmodule @ core.es5.js:4522 ../../../../../src/main.ts @ main.ts:11 __webpack_require__ @ bootstrap e8021dabea79ba711a21:54 0 @ main.ts:11 __webpack_require__ @ bootstrap e8021dabea79ba711a21:54 webpackjsonpcallback @ bootstrap e8021dabea79ba711a21:25 (anonymous) @ main.bundle.js:1

already installed latest version of node, npm , annuler/cli

please check if have imported formsmodule in app.module.ts file if not please add following code

import { formsmodule} '@angular/forms'; imports: [            formsmodule ], 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -