草庐IT

angularjs-ng-pattern

全部标签

javascript - Angular 和 jQuery ng-include with document.ready 不工作

我正在尝试使用HMTL加载一个放置在单独html中的组件。问题在于它会在浏览器加载页面后立即调用。下面是我的模态代码:组件代码在这里:termsAndConditions.html×-->Cisco'sGSAshippingPolicyThispolicyoutlinestherequirementsofshippingInternationallyincludingbutnotlimitedto:AllmembersoftheCiscoworkforceareresponsibletoadheretothispolicyASTistonotbeusedforpersona

javascript - 使用 javascript 更改 AngularJS 输入文本值

我正在尝试在浏览器扩展中运行javascript以自动完成在网站上填写表格然后单击按钮的过程——可以通过在地址栏中键入javascript:code来模拟扩展代码。我遇到问题的网站使用angularJS。我有输入字段ID的名称,并使用它们来更改输入字段值。字段已填满,但当我单击按钮时,它说它们未填写,没有值,它们都是错误的。正在进行一些验证,除非我手动输入值,否则不会“看到”我的更改。是否有一种简单的方法来更改仅使用输入字段的id进行验证的AngularJS输入字段的值。代码如下:我尝试使用document.getElementById("shippingAddr-first-name

javascript - Ng2-Charts Linechart 仅显示前 2 个值

我正在开始使用Angular-CLI(beta22.1)初始化的新Angular应用程序。但是当我将测试数据(5个值)添加到我的图表时,它似乎缩放错误并且只显示前两个值并将它们拉伸(stretch)到图表的整个长度(见图)。该项目在其他方面是空白的,不包含任何CSS。我的app.component.html:app.component.tsimport{Component}from'@angular/core';import{BaseChartDirective}from"ng2-charts/ng2-charts";@Component({selector:'app-root',te

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 - ng2-translate (404 not found) 我已经在 system.js 中添加了

我已将ng2-translate安装到我的项目中,但控制台错误一直显示404包和xhr错误。我已将ng2-translate添加到标准angular2quickstart附带的system.config.js,但仍显示404和xhr错误。它要么给我404错误,要么给出未定义错误的注释:/github:关于使用systemconfig.js的问题的线程https://github.com/ocombe/ng2-translate/issues/167varmap={'app':'app',//'dist','@angular':'node_modules/@angular','angul

javascript - 嵌套 ng-bootstrap 选项卡(Angular 2)

我正在尝试嵌套ng-bootstrap选项卡小部件,但嵌套选项卡的内容未正确显示。当我点击嵌套选项卡时,内容本身就会消失。Minimaldemo我做错了什么?这是View代码:{{tab.title}}{{tab.content}}112233 最佳答案 更新Angular4.3.6包含针对此问题的修复。https://github.com/ng-bootstrap/ng-bootstrap/issues/1433#issuecomment-325104017以前的版本这是一个错误。可能的解决方法可能是使用额外的模板,例如:{{ta

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

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