草庐IT

angular-touch

全部标签

javascript - 找不到 Angular 6 setTimeout 模块 : Error: Can't resolve 'timers'

我有一个问题。我想在2秒后以Angular使用setTimeout来调用一个函数,但我得到了这个:ERROR:Modulenotfound:Error:Can'tresolve'timers';thisismyfunction:login(user){console.log(user.value);this.loginService.loginUser(user.value);//this.user=this.loginService.getUser();setTimeout(()=>{this.user=this.loginService.getUser();},2000);if(t

javascript - 使用 Angular JS 删除 Facebook OAuth 哈希

Facebook点赞加#_=_到我们提供的OAuth回调URL的末尾。虽然我们没有使用基于哈希的导航,但它看起来很烦人,我想摆脱它。location.hash='';在$watch中导致无限循环(这也发生在$window.location.hash='';上)。$location.hash('');的Angular方式没有任何改变。$location.path('');让我们参与其中,导致/#/附加到我们的网址。我也玩过$locationProvider.html5Mode除了错误,什么也没有收到。(Error:[$injector:unpr]Unknownprovider:$loca

javascript - 如何要求 btn-radio Angular Bootstrap 按钮?

我正在使用一组Bootstrap标签按钮作为单选按钮(正如它们在此处的AngularBootstrap文档中所述-http://angular-ui.github.io/bootstrap/)。他们工作得很好。我唯一的问题是,您如何对它们应用验证?你如何要求一个被选中?复选框也是如此。对此有什么想法吗?我敢肯定我不是唯一这样做的人。以下是html/angular的片段。YesNo 最佳答案 我有类似的问题。我准备了以下解决方法,以使用不可检查的UIBootstrap单选按钮验证“必需”。为单选按钮提供不同的ng-model为实际的n

javascript - Angular Directive(指令)内存泄漏?

我正在使用这个简单的html文件重现我发现的内存泄漏:varapp=angular.module('testApp',[]);app.directive('directive1',function(){return{template:'',scope:true};});app.directive('directive2',function(){functionLeakObject(){}functionFoo(){this.bar=function($scope){$scope.nottheredude;};}return{scope:true,link:function($scope

javascript - Angular Material 和 Safari 浏览器

我注意到Safari不能很好地与AngularMaterial配合使用。看起来兼容性问题无处不在:样式、布局等。有没有其他人遇到过这些问题并且对如何很好地解决这些问题有很好的建议? 最佳答案 在提问的时候,Safari中的AngularMaterial确实存在问题:布局(主要是与flex相关的问题)对话框(位置计算错误/对话框折叠)性能(一些精美的动画,包括涟漪、点击坐标缩放等)您在v0.10.1版本中使用AngularMaterial,实际上一般情况下存在很多问题。然而,如今(实际上在AngularMaterialv1.x之后),

javascript - Angular 2 路由异步解析不会保留导航位置

在尝试访问不允许的页面时,我尝试将用户导航到错误页面。问题是skipLocationChange在这种情况下不起作用。它导航到错误页面,但url更改为根目录。如何保持用户提供的原始url?resolve(route:ActivatedRouteSnapshot):Observable|boolean{returnthis.apiclientService.get('cars/'+route.params['id']).map(response=>{if(response.data.user_id===this.authService.user().id){returnresponse.

javascript - 基于 Angular 路线路径动画路线(v2 +)

而不是像在thisStackOverflowanswer中那样将动画附加到每个被路由到的组件上,或如firstpartoftheofficialdocumentation.一个例子:Inhero-detail.component.ts:import{Component,OnInit}from'@angular/core';import{fadeInOutAnimation}from"app/app-routing.animation";@Component({selector:'app-home',templateUrl:'./home.component.html',animatio

javascript - 如何使用 angular ui bootstrap 在 pop 上显示 html?

我像这样制作弹出窗口演示。当我单击按钮时,它会在右侧显示一个弹出窗口。但现在的问题是我将如何在弹出窗口上显示一些html。Rightangular.module('plunker',['ui.bootstrap']);我有这个HTML我需要如何在弹出时添加它。我知道在bootrap.js中有办法在弹出窗口上添加html。我不想使用它我想使用AngularUIbootrap.jsaddrowDeleterow我做了更多类似的尝试,但未定义。可能我错了,我只是在做RNDRightvara=angular.module('plunker',['ui.bootstrap']);a.direct

javascript - 绑定(bind)到 angular2 中的组件属性

我想在A.该组件的构造函数B.该组件的模板中引用一个组件的属性。这方面的API似乎有点变化,但我希望以下内容能够正常工作://mycomponent.es6.js@Component({selector:'my-component',properties:{'greeting':'greeting'}})@View({template:'{{greeting}}world!'})classApp{constructor(){console.log(this.properties)//justaguess}}Plunkr我做错了什么? 最佳答案

javascript - 在 Angular Directive(指令)中从父级继承的新范围

假设我这样做:sAngular.app.directive('dostuff',['$compile',function($compile){return{restrict:'C',scope:{someVar:'='},link:function(scope,element,attrs){element.click(function(){//dostuffscope.someVar='somethingelse';vardropdownOutput=template();varcompiledOutput=$compile(dropdownOutput)(scope);scope.$