本文整理汇总了TypeScript中angular.extend函数的典型用法代码示例。如果您正苦于以下问题:TypeScript extend函数的具体用法?TypeScript extend怎么用?TypeScript extend使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了extend函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: function
this.show = function (customModalDefaults: angular.ui.bootstrap.IModalSettings,
customModalOptions: ModalOptions): angular.IPromise<any> {
// Create temp objects to work with since we're in a singleton service
let tempModalDefaults: angular.ui.bootstrap.IModalSettings = {};
let tempModalOptions: ModalOptions = {};
// Map angular-ui modal custom defaults to modal defaults defined in service
angular.extend(tempModalDefaults, modalDefaults, customModalDefaults);
// Map modal.html $scope custom properties to defaults defined in service
angular.extend(tempModalOptions, modalOptions, customModalOptions);
if (!tempModalDefaults.controller) {
tempModalDefaults.controller = ['$scope', '$uibModalInstance',
function ($scope: ShowControllerScope,
$modalInstance: angular.ui.bootstrap.IModalInstanceService) {
$scope.modalOptions = tempModalOptions;
$scope.modalOptions.ok = function (result: any) {
$modalInstance.close(result);
};
$scope.modalOptions.close = function () {
$modalInstance.dismiss('cancel');
};
}
];
}
return this.open(tempModalDefaults).result;
};
开发者ID:ermshiperete,项目名称:web-languageforge,代码行数:30,代码来源:modal.service.ts
示例2: function
angular.forEach(processor.validationErrors, function (error:any) {
var copy:any = {};
angular.extend(copy, error);
angular.extend(copy, processor);
copy.validationErrors = null;
errorMap[error.severity].push(copy);
count++;
});
开发者ID:prashanthc97,项目名称:kylo,代码行数:8,代码来源:FeedCreationErrorService.ts
示例3: function
.config(['$tooltipProvider', '$alertProvider', function ($tooltipProvider: ITooltipProvider, $alertProvider: IAlertProvider) {
angular.extend($tooltipProvider.defaults, {
container: 'body',
trigger: 'hover'
});
angular.extend($alertProvider.defaults, {
container: '.alerts-wrapper',
placement: 'top-right'
});
}])
开发者ID:Ortolang,项目名称:market,代码行数:10,代码来源:app.module.ts
示例4: resourceClassFactory
function resourceClassFactory($resource: IResourceService, ...args: any[]): any {
const newResource: IResourceClass<any> = $resource(target.url, target.params, target.actions, target.options);
return attachInjects(angular.extend(newResource, angular.extend(target, newResource, {
prototype: angular.extend(newResource.prototype, angular.extend(target.prototype, {
/* tslint:disable:variable-name */
$_Resource: newResource
/* tslint:enable:variable-name */
}))
})), ...args);
}
开发者ID:luisvt,项目名称:ngts-annotations,代码行数:10,代码来源:at-angular-resource.ts
示例5:
this.categoryModel.find(this.categories[index].id).then((category: Category): void => {
// Disable navigation on the table
this.ogTableNavigableService.enabled = false;
let modalOptions: IModalSettings = {
backdrop: "static"
};
// Check if the category has any transactions
if (category.num_transactions > 0) {
// Show an alert modal
modalOptions = angular.extend({
templateUrl: OgModalAlertView,
controller: "OgModalAlertController",
controllerAs: "vm",
resolve: {
alert: (): OgModalAlert => ({
header: "Category has existing transactions",
message: "You must first delete these transactions, or reassign to another category before attempting to delete this category."
})
}
}, modalOptions);
} else {
// Show the delete category modal
modalOptions = angular.extend({
templateUrl: CategoryDeleteView,
controller: "CategoryDeleteController",
controllerAs: "vm",
resolve: {
category: (): Category => this.categories[index]
}
}, modalOptions);
}
// Show the modal
this.$uibModal.open(modalOptions).result.then((): void => {
// If the deleted category has a parent, decrement the parent's children count
if (!isNaN(Number(this.categories[index].parent_id))) {
// Find the parent category by it's id
const parentIndex = this.categoryIndexById(this.categories[index].parent_id);
// If found, decrement the number of children
if (!isNaN(parentIndex)) {
this.categories[parentIndex].num_children--;
}
}
// Remove the category (and any children) from the array
this.categories.splice(index, 1 + this.categories[index].num_children);
// Go back to the parent state
this.$state.go("root.categories");
}).finally((): true => (this.ogTableNavigableService.enabled = true));
});
开发者ID:scottohara,项目名称:loot,代码行数:54,代码来源:index.ts
示例6: NgTableParams
function createNgTableParams<T>(settings?: any): INgTableParams<T> {
var initialParams: IParamValues<T>;
if (arguments.length === 2) {
initialParams = arguments[0];
settings = arguments[1];
}
settings = ng1.extend({}, settings);
settings.filterOptions = ng1.extend({}, {
filterDelay: 0
}, settings.filterOptions);
var tableParams = new NgTableParams(initialParams, settings);
spyOn(tableParams.settings(), 'getData').and.callThrough();
return tableParams;
}
开发者ID:Timeyit,项目名称:main,代码行数:15,代码来源:tableSpec.spec.ts
示例7: function
this.settings = function(newSettings?: ISettings<T>) {
if (ng1.isDefined(newSettings)) {
// todo: don't modify newSettings object: this introduces unexpected side effects;
// instead take a copy of newSettings
if (newSettings.filterOptions){
newSettings.filterOptions = ng1.extend({}, _settings.filterOptions, newSettings.filterOptions);
}
if (newSettings.groupOptions){
newSettings.groupOptions = ng1.extend({}, _settings.groupOptions, newSettings.groupOptions);
}
if (ng1.isArray(newSettings.dataset)) {
//auto-set the total from passed in dataset
newSettings.total = newSettings.dataset.length;
}
var originalDataset = _settings.dataset;
_settings = ng1.extend(_settings, newSettings);
if (ng1.isArray(newSettings.dataset)) {
optimizeFilterDelay();
}
// note: using != as want null and undefined to be treated the same
var hasDatasetChanged = newSettings.hasOwnProperty('dataset') && (newSettings.dataset != originalDataset);
if (hasDatasetChanged) {
if (isCommittedDataset){
this.page(1); // reset page as a new dataset has been supplied
}
isCommittedDataset = false;
var fireEvent = function () {
ngTableEventsChannel.publishDatasetChanged(self, newSettings.dataset, originalDataset);
};
if (initialEvents){
initialEvents.push(fireEvent);
} else {
fireEvent();
}
}
log('ngTable: set settings', _settings);
return this;
}
return _settings;
};
开发者ID:Timeyit,项目名称:main,代码行数:48,代码来源:ngTableParams.ts
示例8: return
return (stencilSetData:any,modelData:any,options?:any):any => {
ORYX.Core.UIObject.prototype.addEventHandlers=function(node) {
var $node=angular.element(node);
$node.on(ORYX.CONFIG.EVENT_MOUSEDOWN, this._delegateEvent.bind(this));
$node.on(ORYX.CONFIG.EVENT_MOUSEMOVE, this._delegateEvent.bind(this));
$node.on(ORYX.CONFIG.EVENT_MOUSEUP, this._delegateEvent.bind(this));
$node.on(ORYX.CONFIG.EVENT_MOUSEOVER, this._delegateEvent.bind(this));
$node.on(ORYX.CONFIG.EVENT_MOUSEOUT, this._delegateEvent.bind(this));
$node.on('click', this._delegateEvent.bind(this));
$node.on(ORYX.CONFIG.EVENT_DBLCLICK, this._delegateEvent.bind(this));
};
if(!options) options={};
var ssUrl = (modelData.model.stencilset.namespace || modelData.model.stencilset.url).replace("#", "%23");
ORYX.Core.StencilSet.loadStencilSet(ORYX.CONFIG.STENCILSET_HANDLER + ssUrl, modelData.model.resourceId, stencilSetData);
angular.extend(options,{
createCanvasWrapper:false,
isGenerateGUI:false,
enableMakeExtModalWindowKeysave:false,
enableLoadContentModel:false,
enableLoadPlugins:false,
});
var editor= new ORYX.Editor(modelData,options);
var facade= editor._getPluginFacade();
var oryxDragDropResize=oryxDragDropResizeFactory(facade);
editor.registerOnEvent(ORYX.CONFIG.EVENT_SELECTION_CHANGED, oryxDragDropResize.onSelectionChanged.bind(oryxDragDropResize));
return editor;
}
开发者ID:hcacha,项目名称:angular-oryx-editor,代码行数:31,代码来源:bpmn-editor-oryx.factory.ts
示例9: function
app.controller('ContactMapCtrl', ['$scope', function($scope) {
const office = {
lat: 52.53849,
lng: 13.38520
};
angular.extend($scope, {
center: {
lat: office.lat,
lng: office.lng,
zoom: 12
},
markers: {
officeMarker: {
lat: office.lat,
lng: office.lng,
focus: true,
message: '<h4 class="ph-no-margin-top">' +
'PaperHive office ' +
'<small class="ph-newline">Room ACK390, Entrance H</small>' +
'</h4>' +
'Ackerstr. 76<br/>13355 Berlin<br/>Germany',
draggable: false
}
}
});
}]);
开发者ID:carolinagc,项目名称:paperhive-frontend,代码行数:26,代码来源:contact.ts
示例10: triggerClick
function triggerClick(el, options?) {
options = angular.extend(
{
metaKey: false,
ctrlKey: false,
shiftKey: false,
altKey: false,
button: 0,
},
options || {}
);
const e = document.createEvent('MouseEvents');
e.initMouseEvent(
'click', // typeArg of type DOMString, Specifies the event type.
true, // canBubbleArg of type boolean, Specifies whether or not the event can bubble.
true, // cancelableArg of type boolean, Specifies whether or not the event's default action can be prevented.
undefined, // viewArg of type views::AbstractView, Specifies the Event's AbstractView.
0, // detailArg of type long, Specifies the Event's mouse click count.
0, // screenXArg of type long, Specifies the Event's screen x coordinate
0, // screenYArg of type long, Specifies the Event's screen y coordinate
0, // clientXArg of type long, Specifies the Event's client x coordinate
0, // clientYArg of type long, Specifies the Event's client y coordinate
options.ctrlKey, // ctrlKeyArg of type boolean, Specifies whether or not control key was depressed during the Event.
options.altKey, // altKeyArg of type boolean, Specifies whether or not alt key was depressed during the Event.
options.shiftKey, // shiftKeyArg of type boolean, Specifies whether or not shift key was depressed during the Event.
options.metaKey, // metaKeyArg of type boolean, Specifies whether or not meta key was depressed during the Event.
options.button, // buttonArg of type unsigned short, Specifies the Event's mouse button.
null // relatedTargetArg of type EventTarget
);
el[0].dispatchEvent(e);
}
开发者ID:angular-ui,项目名称:ui-router,代码行数:32,代码来源:stateDirectivesSpec.ts
注:本文中的angular.extend函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论