// from vk source
var _ua = window.navigator.userAgent;
var browser = {
version: (_ua.match( /.+(?:me|ox|on|rv|it|era|opr|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
opera: (/opera/i.test(_ua) || /opr/i.test(_ua)),
msie: (/msie/i.test(_ua) && !/opera/i.test(_ua) || /trident\//i.test(_ua)),
msie6: (/msie 6/i.test(_ua) && !/opera/i.test(_ua)),
msie7: (/msie 7/i.test(_ua) && !/opera/i.test(_ua)),
msie8: (/msie 8/i.test(_ua) && !/opera/i.test(_ua)),
msie9: (/msie 9/i.test(_ua) && !/opera/i.test(_ua)),
mozilla: /firefox/i.test(_ua),
chrome: /chrome/i.test(_ua),
safari: (!(/chrome/i.test(_ua)) && /webkit|safari|khtml/i.test(_ua)),
iphone: /iphone/i.test(_ua),
ipod: /ipod/i.test(_ua),
iphone4: /iphone.*OS 4/i.test(_ua),
ipod4: /ipod.*OS 4/i.test(_ua),
ipad: /ipad/i.test(_ua),
android: /android/i.test(_ua),
bada: /bada/i.test(_ua),
mobile: /iphone|ipod|ipad|opera mini|opera mobi|iemobile|android/i.test(_ua),
msie_mobile: /iemobile/i.test(_ua),
safari_mobile: /iphone|ipod|ipad/i.test(_ua),
opera_mobile: /opera mini|opera mobi/i.test(_ua),
opera_mini: /opera mini/i.test(_ua),
mac: /mac/i.test(_ua),
search_bot: /(yandex|google|stackrambler|aport|slurp|msnbot|bingbot|twitterbot|ia_archiver|facebookexternalhit)/i.test(_ua)
};
<select
name="station_a"
ng-controller="Stations"
id="station_a"
ng-model="myStation"
ng-options="station.name for station in data">
<option value="">-- choose station --</option>
</select>
var app = angular.module('metroTime', []);
app.controller('Stations', function($scope) {
$scope.data = [
{
'name': 'Героев Днепра',
'time_to_nxt': 2
},
{
'name': 'Минская',
'time_to_nxt': 1.4
},
{
'name': 'Оболонь',
'time_to_nxt': 2.15
}
];
});
angular.bootstrap(document, ['metroTime'])
// from jQuery lib
globalEval: function( data ) {
if ( data && rnotwhite.test( data ) ) {
// We use execScript on Internet Explorer
// We use an anonymous function so that context is window
// rather than jQuery in Firefox
( window.execScript || function( data ) {
window[ "eval" ].call( window, data );
} )( data );
}
}
<div ng-controller="demo">
<table>
<tr ng-repeat="phone in phones">
<td>{{phone.id}}</td>
<td>{{phone.cat}}</td>
<td>{{phone.name}}</td>
</tr>
</table>
</div>
var app = angular.module('app', [])
.controller('demo', function($scope){
$scope.phones = [{id: 1, cat: 'Nokia', name: 'N90'}];
});
angular.bootstrap(document, ['app']);
var el = event.target || event.srcElement
var $el = $( event.target );