Issue 1:
`app.component.html:-

CRUD for Cars

{{i.value}}{{j==3&&countnum<12 ? callme() : ''}}

<p-dialog header="Car Details" [(visible)]="displayDialog" [responsive]="true" showEffect="fade" [modal]="true">
<div class="ui-grid ui-grid-responsive ui-fluid ui-grid-pad" *ngIf="car">
<div class="ui-grid-row">
<div class="ui-grid-col-4"><label for="vin">Vin</label></div>
<div class="ui-grid-col-8"><input pInputText id="vin" [(ngModel)]="car.vin" /></div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-4"><label for="brand">Year</label></div>
<div class="ui-grid-col-8"><input pInputText id="brand" [(ngModel)]="car.year" /></div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-4"><label for="brand">Brand</label></div>
<div class="ui-grid-col-8"><input pInputText id="brand" [(ngModel)]="car.brand" /></div>
</div>
<div class="ui-grid-row">
<div class="ui-grid-col-4"><label for="color">Color</label></div>
<div class="ui-grid-col-8"><input pInputText id="color" [(ngModel)]="car.color" /></div>
</div>
</div>
<footer>
<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
<button type="button" pButton icon="fa-close" (click)="delete()" label="Delete"></button>
<button type="button" pButton icon="fa-check" (click)="save()" label="Save"></button>
</div>
</footer>
</p-dialog>

`
`app.component.ts:-
-------------------
import {Component,Input} from '@angular/core';
import {Car} from './cars/car';
import {CarService} from './cars/carservice';
import {SelectItem} from 'primeng/primeng';
class PrimeCar implements Car {
constructor(public vin?, public year?, public brand?, public color?) {}
}

@component({

templateUrl: 'app/app.component.html',

selector: 'my-app'

})

export class AppComponent {

displayDialog: boolean;

car: Car = new PrimeCar();

selectedCar: Car;

newCar: boolean;
brands: SelectItem[];
bra:SelectItem[];
cars: Car[];
cities: SelectItem[];
heroes: any[];
selectedCity: string;
countnum:number;
constructor(private carService: CarService) {
this.countnum=0;
this.numbers = Array(5).fill().map((x,i)=>i); // [0,1,2]
//this.num = Array(5).fill().map((x,i)=>i); // [1,2,0]
this.brands = [];
this.brands.push({label: '1', value: 'fuck',selectit:2});
this.brands.push({label: '2', value: 'Audi',selectit:2});
this.brands.push({label: '0', value: 'BMW',selectit:1});
this.bra=[];
this.bra.push({label: '1', value: 'fuck',selectit:2});
this.heroes=[1,2,3,3,2,1,2,2,3,1];

}

ngOnInit() {

this.carService.getCarsMedium().then(cars => this.cars = cars);
}
@Input()

set ready(isReady: boolean)

{

if (isReady)

{

console.log('hello');

}

}

showDialogToAdd() {

this.newCar = true;

this.car = new PrimeCar();

this.displayDialog = true;

}

save() {
if(this.newCar)
this.cars.push(this.car);
else
this.cars[this.findSelectedCarIndex()] = this.car;

this.car = null;
this.displayDialog = false;
}

delete() {
this.cars.splice(this.findSelectedCarIndex(), 1);
this.car = null;
this.displayDialog = false;
}

onRowSelect(event) {
this.newCar = false;
this.car = this.cloneCar(event.data);
this.displayDialog = true;
}

cloneCar(c: Car): Car {
let car = new PrimeCar();
for(let prop in c) {
car[prop] = c[prop];
}
return car;
}

findSelectedCarIndex(): number {
return this.cars.indexOf(this.selectedCar);
}
callme()
{
this.countnum=this.countnum+1;
this.heroes[0]=this.heroes[this.countnum];
}

}`

I have rendered a primeng datatable and a column of drop downs if you observe my code I am trying to select default value for each drop down as

drop down 1 - default selected value is "Audi"

drop down 2 - default selected value is "BMW" but I am not successful please help

https://plnkr.co/edit/IWluMiywDBwZVIhCWOKn?p=preview

Issue 2:
I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Currently NgModel does object reference comparison. This is not very flexible.

Minimal reproduction of the problem with instructions

See example with two multi selects - first one doesn't use workaround to enforce usage of same instances. The second one does.

http://plnkr.co/edit/MND6j3Wa5ZDsIt9X9ZVQ?p=preview

What is the motivation / use case for changing the behavior?

Objects do not always come from the same source. They typically come from some REST service. And they usually don't have the same instance.

Current behavior requires workaround for something I believe to be very (if not the most) common use case. I think those should be supported by framework without requiring any workarounds.

Suggested solution

I suggest creating comparator object (or callback) which would compare two objects and return true if they are equal. NgModel would then internally use this comparator to compare objects.

Resulting code could look like this:

<select multiple class="form-control"
name="selectedCountries"
[ngComparator]="countryComparator"
[(ngModel)]="selectedCountries">
<option *ngFor="let country of countries" [ngValue]="country">
{{country.name}}
</option>
</select>

Framework could also provide some default comparators - for example one, which would compare object attributes. That one would be sufficient for quite a lot of use cases.

If there already is some standard solution, please point me to it. I tried to search and I didn't find anything. I found just this stack overflow post describing the same problem, but not providing any solution.