Pasta: fd5210c4cb618e5bc6ab2f30461a3530394a1289 (2014-08-10)

Język: JavaScript
Adres: p43.pl/p,fd5210c4cb618e5bc6ab2f30461a3530394a1289
Ilość linii: 14
Rozmiar: 0.53 kB
Wyświetleń: 432
Ostatnio użyto: 2017-09-13 00:16:34
angular.module('demoApp', []).controller('DemoController', function($scope) { $scope.options = [ { label: 'one', value: 1 }, { label: 'two', value: 2 } ]; // Although this object has the same properties as the one in $scope.options, // Angular considers them different because it compares based on reference $scope.incorrectlySelected = { label: 'two', value: 2 }; // Here we are referencing the same object, so Angular inits the select box correctly $scope.correctlySelected = $scope.options[1]; });