angular.module('applicaton', [])
.factory('fooBar', function() {
function Service() {
var param = null;
this.setParam = function(param) {
param = param;
};
this.getParam = function() {
return param;
};
}
return function() {
return new Service();
}
})
.directive('sample', function() {
return {
restrict: 'AE',
scope: false,
controller: function(fooBar) {
var service = fooBar();
service.setParam('test');
}
};
});
if (navigator.userAgent.indexOf("u3 kernel") !== -1) {
// UC Browser
}
$x = array(
"name" => "Сулаймон",
"custom" => array(
array(
"name" => "country",
"content" => "Узбекистан",
),
array(
"name" => "last_date",
"content" => "2015-09-15",
),
),
);
echo json_encode($x);
// {"name":"\u0421\u0443\u043b\u0430\u0439\u043c\u043e\u043d","custom":[{"name":"country","content":"\u0423\u0437\u0431\u0435\u043a\u0438\u0441\u0442\u0430\u043d"},{"name":"last_date","content":"2015-09-15"}]}
"some random string".split(/[\s\-]/).slice(0, 2); // ["some", "random"]
"some-random string".split(/[\s\-]/).slice(0, 2); // ["some", "random"]
"some random-string".split(/[\s\-]/).slice(0, 2); // ["some", "random"]
"some-random-string".split(/[\s\-]/).slice(0, 2); // ["some", "random"]
Function array dereferencing has been added, e.g. foo()[0].