拿到:
http.request('js/app/config/config.json').subscribe(data => {
this.url = data.json().url;
});
Run Code Online (Sandbox Code Playgroud)
并以某种方式"这"指向订阅者.不知道为什么......因为我认为fat-arrow lambda会捕获父类的指针.
为什么这样?
为 Android webView 编写了一些渲染器。尝试像这样调用一些 javascript:
if (Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat)
{
this.Control.EvaluateJavascript(@"javascript: alert('asdasd');", new ValueCallback(() => { }));
}
else
{
this.Control.LoadUrl(@"javascript:alert('asdasd');");
}
Run Code Online (Sandbox Code Playgroud)
之前我设置了
this.Control.Settings.JavaScriptEnabled = true;
Run Code Online (Sandbox Code Playgroud)
并且没有任何反应。我在 ValueCallback 类中看不到警报或任何操作。我做错了什么?
所以这是我的父母表格:
<form [ngFormModel]="formModel">
<ui-form-control *ngFor="#key of controlsKeys"
[control]="formModel.controls[key]"
[name]="key">
</ui-form-control>
</form>
Run Code Online (Sandbox Code Playgroud)
这是我的组件:
@Component({
selector: 'ui-form-control'
})
@View({
template: `
<label>{{name}}: </label>
<input [ngFormControl]="control" [placeholder]="name">
`,
directives: [FORM_DIRECTIVES]
})
export class UiFormControl{
@Input() control: UiControl;
@Input() name: string;
constructor(){
}
}
Run Code Online (Sandbox Code Playgroud)
我可以在ui-form-component中看到Control值,但是当我更改它时,formModel-ComponentGroup不会更新。因此,似乎两种绑定方式在这里不起作用。
实际上,如果我删除我的标签<ui-form-control>
并放置简单<input>
标签,它将正常工作,并且formModel将按预期更新。
我已经用 WepApi 2 编写的 api 与主网站紧密结合。我决定将它与另一个 Web 应用程序分离,以保持更孤立的状态。
我遵循了以下步骤:
Creat 属性将当前使用旧 URL 的所有用户重定向到新 URL。出于这些原因,我使用了307 状态代码,因为我们应该保留用户请求的动词和请求有效负载。
var response = request.CreateResponse(HttpStatusCode.TemporaryRedirect); //307
response.Headers.Location = new Uri($"{appConfig.ApiAppDomain}" + "/" + request.RequestUri.AbsolutePath + request.RequestUri.Query);
return response;
Run Code Online (Sandbox Code Playgroud)总的来说,它工作得很好。客户端得到 307 然后跟随到Location
标题中的 URL 。
问题在这里:主要的网络应用程序是https
,新的 api 是http
. 当我使用邮递员时,它的行为很奇怪,并且将POST
请求替换为请求的GET
所有请求的正文切割。307
一点也不奇怪,因为不允许更改方法和有效负载。
所以这里有几个问题:
我这样做了: 在我的Android应用程序中删除默认Google地图上的Pin? 并做同样的事情.但在我调用之后,地图上没有引脚:startActivity(new Intent(Intent.ACTION_VIEW,uri));
地图以该uri-location为中心,但地图上没有任何针脚掉落.
所以,有一个问题:如何在地图上放针?
我有很多项目的大解决方案.因此,在构建时,它会将许多库复制到构建的输出目录中.如何指定一些DLL文件的输出目录?
例如:
./OutputDir/Libraries/[and here we have some DLL files]
./OutputDir/Program.exe.
Run Code Online (Sandbox Code Playgroud)
一个XCOPY生成后的行动帮助我的所有DLL文件复制到另一个目录.这是构建后的动作:
mkdir "$(ProjectDir)bin\$(ConfigurationName)\Libraries"
xcopy "$(ProjectDir)bin\$(ConfigurationName)\*.dll" "$(ProjectDir)bin\$(ConfigurationName)\Libraries"
Run Code Online (Sandbox Code Playgroud)
我应该如何将这些DLL文件链接到可执行文件?
我有一些问题.我正试图在我的viewModel中将png-image从资源加载到BitmapImage propery,如下所示:
Bitmap bmp = Resource1.ResourceManager.GetObject(String.Format("_{0}",i)) as Bitmap;
MemoryStream ms = new MemoryStream();
bmp.Save(ms, ImageFormat.Bmp);
BitmapImage bImg = new BitmapImage();
bImg.BeginInit();
bImg.StreamSource = new MemoryStream(ms.ToArray());
bImg.EndInit();
this.Image = bImg;
Run Code Online (Sandbox Code Playgroud)
但是当我这样做时,我失去了图像的透明度.所以问题是如何在不损失透明度的情况下从资源中加载png图像?谢谢,帕维尔.
我们需要防止推送到 bitbucket 存储库上的某个分支。
我们认为我们可以在本地预防它。
有什么方法可以防止通过某些预推送挂钩推送到本地某个分支?
操作系统:Windows。
我想将像"123"这样的字符串转换为像"\ u0031\u0032\u0033"这样的字符串.我怎么能在.NET中这样做?例如:反向转换:
Encoding enc = Encoding.GetEncoding("us-ascii",
new EncoderExceptionFallback(),
new DecoderExceptionFallback());
byte[] by = enc.GetBytes(s);
string ans = enc.GetString(by);
return ans;
Run Code Online (Sandbox Code Playgroud) 我正在开发一些使用com库的代码.我正在尝试通过创建类的实例
Type t = Activator.CreateInstance("TypeID");
Run Code Online (Sandbox Code Playgroud)
但我不能一直得到它的类型= null.progid已经通过Ole/COM Wever查看,似乎我确实输入了它.在什么可能是prolem?
我有一些问题,也许是愚蠢的问题.
我有这个网址:http: //flibusta.net/opds/opensearch?searchTerm =Тол&searchType =books
我想像这样解析响应:
string search_link = "http://flibusta.net/opds/opensearch?searchTerm=???&searchType=books";
_document = new XPathDocument(search_link);
XPathNavigator navigator = _document.CreateNavigator();
XmlNamespaceManager ns = new XmlNamespaceManager(navigator.NameTable);
XPathNodeIterator nodes = navigator.Select("/feed/title");
while (nodes.MoveNext())
{
XPathNavigator currentNavigator = nodes.Current;
string title = currentNavigator.Value;
Trace.WriteLine(title);
}
Run Code Online (Sandbox Code Playgroud)
但节点返回零结果.无法理解我做错了什么.
谢谢,
帕维尔.