Q:

ngModel without providing model name in angular 2

 <input #gb type="text" pInputText class="ui-widget ui-text" ngModel  
 (ngModelChange)="clearFilter($event)">

I didn't assign any model name to ngModel directive in my code, but Angular 2 accepts this, while AngularJS (1.x) doesn't. Which scenario we need to use this kind of ngModel directive without providing  model name?

A:

Angular 2 accepts it because the object could be set later. A proper way of coding this would be to check if the object exists first, and only then show the object if it exists.
For example: You are using a service to instantiate all your objects on the page. Whenever a user goes to one of your pages you do not want to let the user wait for the response of the service, but you want to show them all the content of the page immediately. The service response will instantiate the objects later and only then show them to the users. 
This could be done for example by the onInit interface that Angular 2 provides. This makes sure that you can call on services and instantiate objects after the html elements are already fully loaded. 
Angular2 just gives you this possibility for free because whenever the object doesn't exist, it just won't show them to the user. 
The difference between angularJs (Angular1) and Angular(Angular2 or Angular4) are huge and this is just one of many examples. You could look at it this way: the only thing the two frameworks (AngularJS and Angular2) have in common is that they share a couple of the same letters.

