草庐IT

angularjs-components

全部标签

javascript - 使用 AngularJS 回调的 Google OAuth2 登录

作为引用,这是我正在使用的Google+流程:https://developers.google.com/+/web/signin/server-side-flowUserclicksthesign-inbutton.TheauthorizationrequestissenttoGoogle'sOAuthserversOAuthdialogistriggeredfortheuseraccess_token,id_token,andaone-timecodearereturnedClientsendsid_tokenandcodetoserverServerexchangesone-ti

javascript - 让 ng-repeat 在 AngularJS 的 $interpolate 服务中工作

我正在使用Bootstrap的AngularJs-UI组件。我想将一个填写好的模板插入弹出框功能的数据元素之一。这适用于查找不在ng-repeat内的所有元素。如何让ng-repeat元素在内插模板中工作?我在http://plnkr.co/edit/Cuku7qaUTL1lxRkafKzv有一个plunker它不起作用,因为我不知道如何在plunker中获取Angular-UI-bootstrap。somecontent我的本​​地作用域具有函数createHTML(),看起来像这样。angular.module('myApp',['ngSanitize']).controller(

javascript - 特定标签名称的 AngularJS 指令

如何在AngularJS中为指令强制指定标签?例如,我想创建一个仅应用于的指令标签。如果用户将此指令放在上,我不希望该指令处于事件状态。我该怎么做? 最佳答案 您有2个选择。#1使用您现有的指令并添加几行代码:link:function(scope,element,attr){if(element[0].tagName=='IMG'){//doyourstuff}else{//donothingorsomethingelse}}#2将您的指令限制为一个元素(如FizerKhan的回答所示)。.directive('myIMG',fu

javascript - AngularJS-Bootstrap TypeAhead : TypeError: Cannot read property 'length' of undefined 错误

我在尝试从AngularUI-Bootstrap实现AngularJSTypeahead时遇到以下错误:(我只是调用一个以JSON格式返回结果的servlet)TypeError:Cannotreadproperty'length'ofundefinedathttp://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.11.0.js:3553:24atwrappedCallback(http://ajax.googleapis.com/ajax/libs/angularjs/1.2.10/angular.js:10930:81)at

javascript - Angular 2 : including thirdparty js scripts in component

这个问题在这里已经有了答案:scripttaginangular2template/hookwhentemplatedomisloaded(2个答案)关闭5年前。有没有办法在Angular2组件中包含第三方JS脚本,而不是将其包含在index.html中?我有一个包装数据表的表组件。它是唯一需要包含dataTablesjs/css的组件。如果我能让我的index.html更干净就好了。组件装饰器确实允许您指定css文件。我尝试将我的脚本标签移动到我的组件html中,但这似乎不起作用。

javascript - 有没有更好的方法在 React Component 类中绑定(bind) 'this'?

我目前正在开发一个React应用程序,我发现当一个组件类有很多功能时必须绑定(bind)this有点麻烦。例子classFooextendsComponent{constructor(props){super(props);this.function1=this.function1.bind(this);this.function2=this.function2.bind(this);this.function3=this.function3.bind(this);}function1(){...}function2(){...}function3(){...}}有没有更有效的方法来做

javascript - 要成为一名优秀的 AngularJS 开发人员,我需要了解哪五个 JavaScript 概念?

假设我习惯于在服务器端编码(使用服务器端语言),现在我正在学习AngularJS。这意味着我首先需要对JavaScript有很好的理解。如果我现在没有时间完全学习JavaScript,为了成为一名高效的AngularJS开发人员,您会推荐我首先/很好地学习哪五个JavaScript概念? 最佳答案 类型系统:有两种根本不同的值:基元和对象。Number、string、boolean、null、undefined都是原语。数组([1,2,3])、对象({prop1:value1,prop2:value2})、函数都是对象。protot

javascript - AngularJS - POST 后刷新

在Angular中发出httpPOST请求后刷新内容的正确方法是什么?//controller.jsvarhudControllers=angular.module('hudControllers',[]);hudControllers.controller('PropertyDetailsCtrl',['$scope','$window','$http',function($scope,$window,$http){//IwanttoreloadthisoncethenewCommentFormbelowhasbeensubmitted$http.get('/api/comments

javascript - angularjs + ui 路由器 : redirect to login page when user is not logged in on each state change

我正在使用angularjs和ui-router构建一个简单的博客应用程序,我想监听每个状态变化并检查用户是否已登录。如果他没有登录,我想将他重定向到登录页面。场景非常简单,我试图实现thissolution没有运气。这是相关代码:app.config(function($stateProvider,$urlRouterProvider){$stateProvider.state('app',{url:'',abstract:true});$urlRouterProvider.otherwise('blogs');});app.run(function($rootScope,$stat

javascript - AngularJS ng-style 不随属性改变

我似乎无法弄清楚为什么样式属性没有更新。在我较大的应用程序中,它似乎工作正常。angular.module('Model',[]).factory('SizeModel',function(){return{width:200,height:100,display:"block",getCombined:function(){returnparseInt(this.width)+parseInt(this.height);}};});functionAlbumCtrl($scope,SizeModel){$scope.master=SizeModel;$scope.$watch("ma