.slice(0, 3)
.aux.select();
сделайтеaux.focus();
aux.setSelectionRange(0, 3);
нужно до плюса скопировать, там не всегда 3 символа может быть
'+'
с помощью indexOf
..match(/[^+]*/)
), или удалите его и то, что после (.replace(/\+.*/, '')
). $scope.user = $rootScope.myData
скопированы данные
$scope.user = Object.assign({}, $rootScope.myData)
$scope.user = { ...$rootScope.myData }
Promise.all(items.map((item, index) => axios.post(responses[index], item, config)))
listen(parseInt(port, 65535))
Received NaN.
$ids = array_map(function($n) {
return array_values($n)[0];
}, $array2);
$array1 = array_filter($array1, function($n) use($ids) {
return in_array($n['id'], $ids);
});
const container = document.querySelector('nav');
const itemSelector = '.sidebar-item';
const className = 'selected';
container.addEventListener('click', function(e) {
const item = e.target.closest(itemSelector);
if (item) {
const activeItem = this.querySelector(`.${className}`);
if (activeItem) {
activeItem.classList.remove(className);
}
item.classList.add(className);
}
});
container.addEventListener('click', e => {
const item = e.target.closest(itemSelector);
if (item) {
for (const n of e.currentTarget.querySelectorAll(itemSelector)) {
n.classList.toggle(className, n === item);
}
}
});
const items = container.querySelectorAll(itemSelector);
const onClick = e => items.forEach(n => n.classList.toggle(className, n === e.currentTarget));
items.forEach(n => n.addEventListener('click', onClick));
:loading-options="{ options }"
Property or method "options" is not defined
<div id="progressBar"></div>
<button>green</button>
<button>red</button>
<button>yellow</button>
<button>magenta</button>
<button>aqua</button>
let percent = 0;
const gradientParts = [];
$('button').click(function() {
if (percent < 100) {
const color = $(this).text();
percent++;
gradientParts.push(`${color} ${percent - 1}%`, `${color} ${percent}%`);
const gradient = gradientParts.concat(`#435C91 ${percent}%`, '#435C91 100%');
$('#progressBar').css({
background: `linear-gradient(to right, ${gradient.join(', ')})`,
});
}
});
render() {
const
text = this.state.filterText,
posts = text ? db.filter(n => n.descr.includes(text)) : db;
return(
<div className="App">
<Nav/>
<Header/>
<SearchBar
filterText={this.state.filterText}
onUserInput={this.handleUserInput}
/>
<Posts handleUserIput={this.state.filterText} data={posts}/>
<Footer/>
</div>
);
}
Я реализовал примерно по документации, но...
{{postImage}}
по фигурной скобке с обоих концов убрать, например. let json = {}; fs.readFile('user.json', function (err, data) { json += data.toString(); }); res.json(json);
fs.readFile('user.json', function (err, data) {
res.json(data.toString());
});
Меняю (\d\d) на $1., но сохраняются скобочки.
(\d\d)
попробуйте \((\d+)\)
.