The error was caused by this line:
#inputSearch="ngForm"
This is the correct line:
#inputSearch="ngModel"
Here is the working example. When you use ngModel within the form tag you also need to provide value for the “name” attribute.
<form #searchForm="ngForm"> <input type="text" required name="search" [(ngModel)]="model.search" #inputSearch="ngModel"> <p class="error" [hidden]="inputSearch.valid"> This input is required</p> </form>
Related Posts:
- Angular: conditional class with *ngClass
- Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’
- What is an unhandled promise rejection?
- Angular: mat-form-field must contain a MatFormFieldControl
- (change) vs (ngModelChange) in angular
- Cannot find module ‘@angular-devkit/core’
- No value accessor for form control
- Angular ForEach in Angular4/Typescript?
- Angular 4 setting selected option in Dropdown
- Angular4 – No value accessor for form control
- Angular: conditional class with *ngClass
- Angular: conditional class with *ngClass
- npm WARN … requires a peer of … but none is installed. You must install peer dependencies yourself
- What is ViewChild in Angular2?
- Module not found: Error: Can’t resolve ‘fs’ in
- Angular 2 – Using ‘this’ inside setTimeout
- How to fix Cannot find module ‘typescript’ in Angular 4?
- How to set Angular 4 background image?
- SyntaxError: Unexpected token C in JSON at position 0 – Ionic 2 Http GET request
- Crop the image using JavaScript
- Angular 4 setTimeout() with variable delay and wait
- What does the .subscribe() function do?
- Angular 2 Hover event
- How do I download a file with Angular2 or greater
- What are differences between SystemJS and Webpack?
- How to use forEach loop correctly in angular 2?
- Angular 2 Sort table columns
- How to use onBlur event on Angular2?
- How do I install Angular 2 using NPM?
- Using Angular 2 without TypeScript Transpiler
- Split string into array
- convert Hsl to rgb and hex
- How to play audio?
- “Uncaught TypeError: Cannot read property ‘style’ of null at.. “
- Difference between document.referrer and window.parent.location.href
- JavaScript replace/regex
- how to render a react component using ReactDOM Render
- What does “javascript:void(0)” mean?
- What does this symbol mean in JavaScript?
- Regex for password must contain at least eight characters, at least one number and both lower and uppercase letters and special characters
- OnChange event using React JS for drop down
- how to get the last character of a string?
- Set timeout for ajax (jQuery)
- Escaping Discord subset of markdown
- ESLint Parsing error: Unexpected token
- keep getting “? Something is already running on port 3000” when I do npm start on react app
- React Context vs React Redux, when should I use each one?
- Regular expression : match either of two conditions?
- What is causing the error `string.split is not a function`?
- Difference between innerText, innerHTML and value?
- Uncaught TypeError: data.push is not a function
- Length of a JavaScript object
- TypeError: $(…).modal is not a function with bootstrap Modal
- How to do fade-in and fade-out with JavaScript and CSS
- I want to remove double quotes from a String
- Calculating median – javascript
- Vue is not defined
- How to remove all listeners in an element?
- How do I check if an object has a key in JavaScript?
- How to make your Discord Bot always active
- How to write inside a DIV box with javascript
- use Lodash to sort array of object by value
- Chrome/jQuery Uncaught RangeError: Maximum call stack size exceeded
- How to make fadeOut effect with pure JavaScript
- How to get unique values in an array
- How to fix Error: listen EADDRINUSE while using NodeJS?
- Set scroll position
- .filter is not a function
- Function overloading in Javascript – Best practices
- Wait until flag=true
- momentJS date string add 5 days
- When is a CDATA section necessary within a script tag?
- How to get scrollbar position with Javascript?
- where is create-react-app webpack config and files?
- How to wrap the content of the main tinyMCE editor with extra tags
- Rest API authentication issue when called from fetch request in bundle.js
- Javascript not working?
- Add Item to Custom TinyMCE Menu
- Listbox return wrong value in WordPress 3.9
- Logout user and delete cookies from the client side?
- How do developers add “Smooth Transitions” to their sites?
- How can I get my Calculate Contact Form 7 field to update with jQuery? [closed]
- Where to upload JavaScript file in WordPress
- Calling a WordPress Custom JavaScript file
- Custom Block – save.js function not saving attributes
- How do I know if I should enqueue JS code or just include it in ONE PHP function?
- How can I integrate yepnope.js with WordPress (and plugins)?
- How to set javascript options for select2 in PHP array of plugin
- Multiple jQuery inputs or binds in Customizer Control Javascripts
- How to display different content on the same page using different URLS
- Immediate (e.g. without DOMContentLoaded) JS not working
- Script not working in post content
- How to identify which javascript is being executed
- How could I add load more posts to my theme? [closed]
- How to keep close a sub-menu under homepage? [closed]
- How to implement custom URL handler to access JS modal content? [closed]
- Javascript 2 elements dependent onclick .toggle [closed]
- Passing object to FormTokenField suggestions
- How to Update a variable even if the web page reloads in js