本文整理汇总了TypeScript中angularjs-for-webpack.forEach函数的典型用法代码示例。如果您正苦于以下问题:TypeScript forEach函数的具体用法?TypeScript forEach怎么用?TypeScript forEach使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了forEach函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
const save_draft = function () {
const editableTitle = $('.editable-title').clone();
const editableContent = $('.editable').clone();
// Empty the content of the event lists before saving
angular.forEach(editableContent.find('ts-story-event-list'), function (element) {
$(element).empty();
});
// Remove all dropdown from the document before saving
angular.forEach(editableContent.find('ts-story-dropdown'), function (element) {
$(element).remove();
});
// Current content of the doc
const current_title = editableTitle[0].innerHTML.trim();
const current_content = editableContent[0].innerHTML.trim();
// Only save if there are any changes to the document
if (current_content === scope.last_content && current_title === scope.last_title) {
return;
}
scope.last_content = current_content;
scope.last_title = current_title;
timesketchApi.updateStory(scope.sketchId, scope.storyId, current_title, current_content);
};
示例2: function
$scope.removeStar = function () {
const event_list: any[] = [];
angular.forEach($scope.events, function (event) {
if (event.selected && event.star) {
event.star = false;
event_list.push(event);
}
});
toggleStar(event_list);
};