草庐IT

angular-ui-tab

全部标签

javascript - 如何在带有 ES6 的 webpack 中的 Angular 之前包含 jQuery?

我试过这个:import$from'jquery';window.jQuery=$;importangularfrom'angular';但$.fn.scope未定义且ng-bind-html中的脚本不起作用InjectingascripttagwithngBindHtml也在webpack配置中尝试过这个module.exports={module:{loaders:[{test:/angular(\.min)?\.js$/,loader:"imports?$=jquery"},{test:/jquery(\.min)?\.js$/,loader:'expose?jQuery'}]}

javascript - 自行销毁组件 - angular2

我的组件(main-cmp)包含来自数据库的行。对于行,我为例如创建另一个组件。行-cmpmain-cmp从数据库中请求数据,并解析为在row-cmp中,我声明了delete()函数,它向我的后端调用http请求。现在,当来自请求的响应为真时,我想销毁所选行的row-cmp。这可能吗? 最佳答案 这是不支持的。我建议添加一个事件发射器@Output()delete:EventEmitter=newEventEmitter();然后添加一个事件处理程序,从数据数组中删除该项目 关于java

javascript - Angular 2多重倒计时管道

我正在寻找Angular2/4倒计时管道。当然我可以单独倒计时,但如何创建多个倒计时?我想要以下输入:Countdownwillcounthere例如:CountdownwillcounthereCountdownwillcounthereCountdownwillcounthere无论我有多少,我如何才能实现一切正常?到目前为止我尝试的只是像下面这样的单个倒计时:time=30;setInterval(()=>{this.currentTime=newDate().getTime();if(this.time>0){this.time=this.time-1;}},1000);{{t

javascript - 将 ViewChild 用于动态元素 - Angular 2 和 ionic 2

我想使用多个IonicSlides我动态添加的。但是我不能使用@viewChild。请提出解决此问题的方法。Template.html://somecode组件.ts:@ViewChild('slides')slides:QueryList;....ngAfterViewInit(){setTimeout(()=>{alert(this.slides.toArray());//thislineriseerror},3000);}错误:_this.slides.toArrayisnotafunction 最佳答案 使用@ViewChi

javascript - Angular Material 滑动切换的两种方式绑定(bind)无法按预期工作( Angular 4)

我已经实现了AngularMaterial滑动切换,除了出于某种原因它没有将值绑定(bind)到相关变量之外,一切似乎都有效?//otherirrevelantimportsabove..import{MatDialog,MatDialogRef,MAT_DIALOG_DATA}from'@angular/material';@Component({selector:'app-calendar',templateUrl:'./calendar.component.html',styleUrls:['./calendar.component.scss'],host:{'(document

javascript - Angular 4 : changing url, 但未呈现组件

我正在尝试使用routerLink="selected"从一个组件链接一个组件constroutes:Routes=[{path:'',children:[{path:'account',component:AccountComponent,children:[{path:'selected',component:SelectedComponent,},],},]}];@NgModule({imports:[RouterModule.forChild(routes)],exports:[RouterModule],})exportclassAccountSettingsRoutingM

javascript - 使用 ui 插件时 Jstree 节点不起作用

我发现使用ui插件会破坏树节点的链接。这不是什么新鲜事,我在其他地方找到了对这个问题的引用。第一个原因是jquery验证插件v1.6的问题。我没有使用那个插件,所以这不是原因。我还发现了一个很好的帖子,描述了将jstree-clicked类添加到的几种方法。标签。这看起来很有希望,但当我尝试时,我没有发现任何区别。这是一个非常简单的例子:YAHOO!$(function(){$("#treediv").jstree({"core":{"animation":0},"themes":{"theme":"classic"},"plugins":["themes","html_data","

javascript - 如何从 SP.UI.ModalDialog 获取参数?

我尝试了其他在线建议但没有成功。所以...我打开SharePoint对话框的函数将agrs传递到指定的option对象中,如下所示:设置对话框:这里没有什么神奇的......functionopenEmailDialog(){varoptions=SP.UI.$create_DialogOptions(),url='../Pages/EmailDocument.aspx';options.title="EmailDocuments";options.width=1024;options.height=400;options.allowMaximize=false;options.url

"Open in new Tab"的 Javascript 事件

我有以下问题:我使用Javascriptonclick事件来更改链接的href。它就像一个魅力,但前提是用户只需单击一个链接。如果“在新选项卡中打开”功能用于链接-onclick事件将不会触发并且href永远不会改变。有什么办法可以处理这样的事件吗?也许使用jQuery或其他一些JS框架?例子:Link 最佳答案 努力改变Link到Link 关于"OpeninnewTab"的Javascript事件,我们在StackOverflow上找到一个类似的问题: ht

javascript - Angular : Push item to list doesn't update the view

当我将项目推送到数组时,View不会刷新列表。表格:{{product.Code}}{{product.Name}}形式:Code:Naam:在Controller中提交产品:$scope.submitProduct=function(){console.log('before:'+$scope.products.length);$scope.products.push({Code:$scope.product.Code,Name:$scope.product.Name});console.log('after:'+$scope.products.length);console.log