小编dpd*_*nev的帖子

用于Angular 2 Grid dataBound事件的Kendo UI

有没有办法捕获网格的dataBound事件,类似于我们在jndo版本的Kendo UI中所拥有的事件.我需要在数据加载到网格后执行操作.

有一个dataStateChange事件,但在初始加载期间不会触发此事件.

目前,我正在使用超时功能来延迟执行,但这不是一个永久可靠的解决方案.

谢谢.

kendo-ui kendo-ui-angular2 angular

11
推荐指数
1
解决办法
1657
查看次数

使用LDAP身份验证的OWIN

这是我的情景.我有一个使用Owin作为身份验证机制的MVC 5应用程序.默认模板在Login操作中调用SignInManager.PasswordSignInAsync,我想覆盖它以使用LDAP来验证用户而不是查看数据库.

我可以通过以下方式进行验证:

PrincipalContext dc = new PrincipalContext(ContextType.Domain, "domain.com", "DC=domain,DC=com", "user_name", "password");
        bool authenticated = dc.ValidateCredentials(userName, password);
Run Code Online (Sandbox Code Playgroud)

然后我可以使用以下方法检索UserPrincipal:

UserPrincipal user = UserPrincipal.FindByIdentity(dc, IdentityType.SamAccountName, userName);
Run Code Online (Sandbox Code Playgroud)

但是,我被困在这里,我不知道如何继续签署用户.我的目标是在我登录用户之后,我可以访问User.Identity,包括用户所在的所有角色.实际上,应用程序的行为应该像使用Windows身份验证一样,但凭据由用户提供登录页面.

您可能会问为什么不直接使用Windows身份验证.该应用程序将从网络外部访问,但要求是使用AD身份验证和授权.因此我的困境.

任何建议都非常感谢.

谢谢.

ldap owin asp.net-mvc-5

6
推荐指数
1
解决办法
4331
查看次数

RxJS 观察一个对象

我是 RxJS 的新手,所以我为新手问题道歉。

我有一个本地javascript对象定义为:

model.user = {
  firstName: 'John',
  lastName: 'Smith'
}
Run Code Online (Sandbox Code Playgroud)

我将每个属性绑定到一个输入控件,用户可以在其中更改值。我希望能够观察这个对象并在任何属性的值发生变化时捕获事件。

这可以通过 RxJS 实现吗?

谢谢。

rxjs

5
推荐指数
1
解决办法
2621
查看次数

Nativescript FormattedString - 跨度上的点击事件

我有以下标记:

<StackLayout paddingLeft="15" paddingRight="15" dock="top" >
  <Label textWrap="true">
    <Label.formattedText>
      <FormattedString>
        <FormattedString.spans>
          <Span text="By checking 'yes' I understand that this is a legally valid and binding written agreement, and I indicate that I have read, understand, and agree to the terms of my " />
          <Span text="Agreement. " foregroundColor="#3aba90" tap="viewAgreemnent" />
          <Span text="Also, by checking 'yes', I certify that I have read and agree to accept electronically the "  />
          <Span text="Privacy Policy." foregroundColor="#3aba90" tap="viewPolicy" />
        </FormattedString.spans>
      </FormattedString>
    </Label.formattedText>
  </Label>
</StackLayout> …
Run Code Online (Sandbox Code Playgroud)

nativescript

5
推荐指数
1
解决办法
1699
查看次数

Visual Studio Code 无法识别 Git

我刚刚将 Visual Studio Code 更新到 v.1.19.0,突然无法识别 Git。我仍然可以从终端 (cmd) 窗口执行所有操作,但“源代码管理”选项卡为空,我得到:

未找到 Git。安装它或使用“git.path”设置配置它”

这是我在输出控制台中看到的内容:

Looking for git in: C:\Users\UserName\AppData\Local\Programs\Git\cmd
Looking for git in: C:\Program Files\Git\cmd\git.exe
Looking for git in: C:\Program Files (x86)\Git\cmd\git.exe
Looking for git in: C:\Program Files\Git\cmd\git.exe
Run Code Online (Sandbox Code Playgroud)

在我的设置中我有:

"git.path": "C:\\Users\\UserName\\AppData\\Local\\Programs\\Git\\cmd"
Run Code Online (Sandbox Code Playgroud)

它指向 git.exe 的位置

我不知道为什么,但是当我安装 Git 时,它把它放在AppData文件夹中而不是Program Files中。不管怎样,一切都工作正常,直到今天早上我安装了更新。

如果有帮助的话,我使用的是装有 Windows 10 64 位操作系统和 Git 版本 2.15.1.windows.2 的 Windows 计算机。

为什么 Visual Studio Code 看不到它?

git visual-studio-code

5
推荐指数
1
解决办法
1万
查看次数

从普通对象创建可观察对象

我对 RxJS 很陌生,所以如果已经回答了这个问题,我提前道歉。

我有一个 Angular 2 应用程序,在其中一个组件中我有一个普通对象。我正在将 UI 绑定到这个对象。我想要做的是能够捕获对该对象的所有更改,无论它们来自代码还是来自更改字段之一的用户。

我正在查看可观察对象,但似乎订阅者只能在通过 Emit 方法推送新对象时接收通知。例如,在属性绑定到输入字段的情况下,这将如何工作?

有没有更好的方法来做到这一点?

这是我的代码的样子:

export class MyComponent {
  app: ApplicationModel = new ApplicationModel(); <--- this is the object I want to track
  
  constructor(api: APIService) {
    api.getApplication().then((data) => {
      this.app = data; 
    });
  }
}
Run Code Online (Sandbox Code Playgroud)

我正在寻找类似于 Knockout 允许您接收更改通知的方式:

myViewModel.personName.subscribe(function(newValue) {
    alert("The person's new name is " + newValue);
});
Run Code Online (Sandbox Code Playgroud)

谢谢你。

rxjs angular

3
推荐指数
1
解决办法
2835
查看次数

Piranha CMS在现有的MVC 5网站上

我是食人鱼CMS(以及任何一般的CMS)的新手.我有一个关于将系统集成到现有MVC 5应用程序的问题.这是我到目前为止所做的:

  • 我已按照"入门"部分中的步骤操作
  • 我创建了数据库并设置了连接字符串
  • 我创建了admin用户,可以登录管理器界面

我遇到的问题是了解如何将现有页面带入管理器以及如何将它们公开给用户进行编辑.我确实查看了文档,但找不到任何专门针对此主题的内容.

任何帮助是极大的赞赏.

谢谢.Daniel D.

piranha-cms

1
推荐指数
1
解决办法
2108
查看次数

Nativescript将摄像头捕获发送到服务器

在我的Nativescript应用程序中,我想使用相机模块捕获图像,然后通过http调用将字节直接发送到服务器.

这是我的代码(为简洁起见不完整):

var cameraModule = require("camera");
var http = require("http");
...

cameraModule.takePicture().then(function (img) {
  // how to extract the actual bytes from img???
  
  http.request({
    url: some_url,
    method: "POST",
    headers: { "Content-Type": "application/octet-stream" },
    content: ???
  });
});
Run Code Online (Sandbox Code Playgroud)

有没有办法做到这一点?

我正在查看nativescript-background-http,它似乎完全符合我的要求,但该示例显示了仅从路径加载的文件.我没有运气使这个在iOS上运行.

任何帮助是极大的赞赏.

谢谢.

nativescript

1
推荐指数
1
解决办法
2030
查看次数

物料设计输入货币格式

Material Design中是否有输入格式作为参数.我特别需要货币格式.

如果没有,您会建议采用什么方法来实现此功能.

谢谢.

angularjs material-design

1
推荐指数
1
解决办法
7520
查看次数

nativescript iOS Cocoa Pods 构建错误

当我尝试在 VS Code 中运行我的应用程序时,我最近开始收到一个奇怪的错误:

警告]:警告:CocoaPods 要求您的终端使用 UTF-8 编码。[31;1m 处理 node_modules 失败。异常:Pod 安装命令失败。错误输出:考虑将以下内容添加到 ~/.profile: export LANG=en_US.UTF-8

[NSDebugAdapter] tns 命令以代码 127 完成执行。

有人见过吗?我看到了建议的操作消息,但我不知道 ./profile 在哪里?

我在 El Capitan 上使用 tns 2.5.0 版和 VS Code

nativescript

0
推荐指数
1
解决办法
4909
查看次数