这是我的index.html为了后人的缘故:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="">
<meta name="author" content="">
<base href="/" />
<title>Cart</title>
<link href="content/external/bootstrap.css" rel="stylesheet" />
<link href="content/external/bootstrap-theme.css" rel="stylesheet" />
<link href="content/external/font-awesome.css" rel="stylesheet" />
<link href="content/external/angular-toastr.css" rel="stylesheet" />
</head>
<body ng-app>
{{3+4}}
drfg
<script src="scripts/external/jquery-1.9.1.js"></script>
<script src="scripts/external/bootstrap.js"></script>
<script src="scripts/external/angular.js"></script>
<script src="scripts/external/angular-ui-router.js"></script>
<script src="scripts/external/angular-resource.js"></script>
<script src="scripts/external/angular-mocks.js"></script>
<script …Run Code Online (Sandbox Code Playgroud) 我使用ng2-bootstrap的模态有一个问题.我正在做这里提到的整个viewContainerRef hack .我正在深层嵌套组件中创建一个模态(通过路由深入4级).我从上面的链接中复制了模态代码.每当我尝试打开它时,它会像这样打开:bs-modal-backdrop完全覆盖屏幕,包括模态,阻止我与它交互.知道为什么会这样吗?
我的应用程序上有一个Angular 4 Material Sidenav,它有一堆按钮,其中一些调用函数,另一些调用其他页面.
除了让每个按钮调用相同的函数然后查找要调用的函数(比如发送的参数上的开关)之外,是否有内置的方法让sidenav关闭子点击?
这是sidenav的样子:
<md-sidenav #sidenav align="end">
<br/>
<span style="margin: 17px">{{auth?.userProfile?.name}}</span> <br />
<button md-button routerLink="/spells"> All Spells </button> <br />
<button md-button (click)="login()" *ngIf="!auth.authenticated()">Log In</button>
<button md-button routerLink="/spellbook" *ngIf="auth.authenticated()"> My Spellbooks </button> <br />
<button md-button (click)="auth.logout()" *ngIf="auth.authenticated()">Log Out</button>
</md-sidenav>
Run Code Online (Sandbox Code Playgroud) 我按照 ng2-charts 演示页面上的说明进行设置。我正在使用 angular-cli,所以我也使用 System.JS 导入了包。然后我复制了演示代码,但它不会显示。正在创建画布,但没有绘制图表。我的组件和模板代码与此处完全相同。
我有一个可视化的c#程序正在运行,但每当我尝试更新时,我都会收到连接错误.这是我的代码的样子:
private void Update()
{
try
{
String OneMachineScheduleOrder = "";
String series = "";
String oven = "";
String battery = "";
int x,y;
var sortedTextboxes = panel1.Controls
.OfType<TextBox>() // get all textboxes controls
.OrderBy(ctrl => ctrl.TabIndex); // order by TabIndex
foreach (TextBox txt in sortedTextboxes)
{
//Console.WriteLine(Convert.ToInt32(txt.TabIndex/2+1) + ": " + txt.Text);
OneMachineScheduleOrder = (txt.TabIndex / 2 + 1).ToString();
series = txt.Text.Substring(0, 1);
oven = txt.Text.Substring(1, 2);
battery = txt.Text.Substring(4).Trim();
if (Char.IsLetter(series[0]) && int.TryParse(oven, out y) && int.TryParse(battery, …Run Code Online (Sandbox Code Playgroud) 在.NET 4.0和4.5,默认值ServicePointManager.SecurityProtocol是SecurityProtocolType.Tls|SecurityProtocolType.Ssl3根据.NET 4.0 / 4.5这个职位。
.NET 4.6.1 中的默认值是多少?我在任何地方都找不到
我正在尝试为我的angular2应用程序使用PowerShell 2编写自动化的构建和部署脚本,但是鉴于我们的ASP.NET Web API的使用方式api/,我想删除所有旧的角度代码而不接触API。
到目前为止,这是我得到的:
Get-ChildItem -Path $destination -Recurse -exclude somefile.txt |
Select -ExpandProperty FullName |
Where {$_ -notlike $destination+'\api*'} |
sort length -Descending |
Remove-Item -force -recurse
Run Code Online (Sandbox Code Playgroud)
$destination 是应用程序的安装目录。
快速文件夹树,以防我在上方不清楚:
$destination
api\
app\
assets\
vendor\
index.html
main.js
system-config.js
Run Code Online (Sandbox Code Playgroud)
如上所述,除了 api\
抱歉这个糟糕的头衔.Java applet的目的是这样的:一个球在屏幕上弹跳.这个球的大小和速度可以通过滚动条改变.用户可以在屏幕上按下并拖动鼠标以绘制矩形.球也将从这些矩形反弹.这些矩形的边界存储在矢量中.单击矩形时,将从矢量(和屏幕)中删除它(以及该点处的所有其他矩形).
我遇到的问题有两个:一,当我点击一个矩形去除它时,它不会被删除,但这可以在以后解决.
二:球不会像它应该的那样从矩形反弹.当我在与球相同的行或列中绘制一个矩形时,球会在一个小矩形内部反弹,就像它被卡住一样.
这是我的代码,用于检测球是否正在击中小程序或任何矩形的边界:
public void move()
{
//if it will hit the right or left boundary, flip the x direction and set it
if (loc.x+size >= boundx || loc.x <= 0)
{ dx *= -1; }
//if it will hit the top or bottom boundray, flip the y direction and set it
if (loc.y+size >= boundy || loc.y <= 0)
{ dy *= -1; }
for (int i = 0; i < r.size(); i++)
{
temp = new …Run Code Online (Sandbox Code Playgroud) 我正在创建一个angular2应用程序,我有一个服务,我希望能够在一个组件中写入,然后在其他组件(路由)中读取/更新它.
这是我的服务目前的样子:
import { Injectable } from '@angular/core';
import { Filer } from './filer.model';
import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
@Injectable()
export class FilerService {
public _filer: Subject<Filer>;
constructor() {
this._filer = new Subject();
}
setSelected(ret: Filer) {
let temp = ret;
this._filer.next(temp);
}
get selected(): Observable<Filer> {
return this._filer.asObservable();
}
}
Run Code Online (Sandbox Code Playgroud)
因为我正在使用Subject,只有订阅的组件才能看到任何值.我尝试BehaviorSubject根据rxjs文档将其更改为a .这是看起来像:
import { Injectable } from '@angular/core';
import { Filer } from './filer.model';
import { Observable } …Run Code Online (Sandbox Code Playgroud) 我正在为一个新项目设置开发环境。它是一个 Web API 项目,通过静态文件为 @Angular 项目提供服务。为了促进这一点,在构建后,我运行 Angular cli 的构建函数,然后将文件复制到 wwwroot 中。这一切都工作正常。
但是,我希望能够根据项目处于调试模式还是发布模式来运行两个不同的 npm 脚本。在我的构建后脚本中,我尝试了以下方法:
if "$(ConfigurationName)" == "Debug"
(
npm run build
)
else if "$(ConfigurationName)"=="Release"
(
npm run prod
)
Run Code Online (Sandbox Code Playgroud)
但我得到了
The command "if "" == "Debug"
(
npm run build
)
else if ""=="Release"
(
npm run prod
)" exited with code 255.
Run Code Online (Sandbox Code Playgroud)
看起来没有为 ConfigurationName 提供任何值。我尝试过调试和发布模式并得到相同的错误。VS 2017 中的 ConfigurationName 变量是否发生了变化?
编辑:但是,如果我单击“编辑构建后”,然后单击“宏”,我可以在此处看到ConfigurationName 有一个值。只是我的脚本没有看到它
我收到了客户发送来的条件清单。我需要获取此列表并创建一个由 EntityFramework 执行的动态 where 子句。
每个条件都有一个运算符、一个属性和一个右侧值。
每个条件列表都需要进行“与”运算。
每个条件列表列表都需要进行“或”运算。
所以如果我们有
{
"ConditionLists":[
[
{
"LhsAttributeDefinition":{
"attribute":{
"key":"isHighBandwidth",
"value":"IsHighBandwidth"
}
},
"Operator":{
"name":"equals",
"description":"=",
"validation":"",
"inputType":"dropdown"
},
"RhsValue":"true"
},
{
"LhsAttributeDefinition":{
"attribute":{
"key":"isForMobile",
"value":"IsForMobile"
}
},
"Operator":{
"name":"equals",
"description":"=",
"validation":"",
"inputType":"dropdown"
},
"RhsValue":"true"
}
],
[
{
"LhsAttributeDefinition":{
"attribute":{
"key":"isHighBandwidth",
"value":"IsHighBandwidth"
}
},
"Operator":{
"name":"equals",
"description":"=",
"validation":"",
"inputType":"dropdown"
},
"RhsValue":"true"
},
{
"LhsAttributeDefinition":{
"attribute":{
"key":"isForTablet",
"value":"IsForTablet"
}
},
"Operator":{
"name":"equals",
"description":"=",
"validation":"",
"inputType":"dropdown"
},
"RhsValue":"true"
}
]
]
}
Run Code Online (Sandbox Code Playgroud)
那应该生成.Where(x => …
我正在制作一个新的angular2应用程序,它将在我们所有服务器上的所有应用程序上获得一个端点以获取内部版本号,然后它将在网格中显示它们,以便我们可以看到哪些服务器具有哪些内部版本号.
当我使用Angular1构建类似的应用程序时,我能够使用gulp -ng-config读取JSON文件并使用JSON中的值输出角度模块.我想在Angular2中做类似的事情,但我不知道如何做到这一点.有任何想法吗?
我正在编写ASP webapp,底部有一个更新按钮.当单击更新按钮时,它应该从表中的两个单元格中获取数据(一个是复选框,另一个是文本输入(值将是一个双精度).我写了一个javascript函数来获取值的复选框,并将其放在更新的URL字符串的其余部分.这是:
<script>
function getUpdateHTML()
{
var updatestring = "window.location='RollInventoryViewDev.asp?YNChecked=";
updatestring = updatestring + document.getElementById("cellRollLockoutYN").checked + "&";
updatestring = updatestring + "action=update&sort=roll_id&sortdir=<%=intSortDir%>&id=<%=intRollID%>&iddt=<%=StrRollIdDt%>&seqnum=<%=intRollSeqNum%>&findesc=<%=strRollFinishDescription%>&fincd=<%=strRollFinishCD%>&diam=<%=dblRollDiameter%>&crown=<%=dblRollCrown%>&crownaim=<%=dblRollCrownAim%>&prosrough=<%=intRollProsRoughness%>&peaksrough=<%=intRollPeaksRoughness%>&hardness=<%=intRollHardness%>&metalcd=<%=strRollMetalCD%>&rolltype=<%=strRollType%>&lockout=<%=chrRollLockoutYN%>&depthavg=<%=dblProductPatternDepthAvg%>'";
return updatestring;
}
</script>
Run Code Online (Sandbox Code Playgroud)
这是它被调用的地方:
<input type=button value="Update" onClick="getUpdateHTML()"></input>
Run Code Online (Sandbox Code Playgroud)
函数执行后,我希望字符串执行.因此,例如,函数可能会返回:
RollInventoryViewDev.asp?YNChecked=true&action=update&sort=roll_id&sortdir=0&id=9307&iddt=1/1/1995&seqnum=89&findesc=VIT&fincd=VIT &diam=24.651&crown=0.0041&crownaim=&prosrough=225&peaksrough=150&hardness=832&metalcd=2FST&rolltype=Work&lockout=Y&depthavg=1.5
Run Code Online (Sandbox Code Playgroud)
我希望页面重新加载该URL,但我不知道如何实现这一点.
抱歉这个愚蠢的问题.这是我第一次使用Javascript.我希望能够使用ASP完成所有这些操作但我决定在Javascript中实现它会更容易.
angular ×5
.net ×2
c# ×2
html ×2
javascript ×2
.net-core ×1
angular-cli ×1
applet ×1
asp-classic ×1
asp.net ×1
asp.net-4.6 ×1
css ×1
expression ×1
java ×1
lambda ×1
mouseevent ×1
msbuild ×1
ng2-charts ×1
oracle ×1
powershell ×1
rectangles ×1
rxjs ×1
rxjs5 ×1
server ×1
webstorm ×1