小编max*_*sam的帖子

Twitter引导多个模态错误

我试着在另一个模态中有一个模态.但是,我在Firefox中遇到了"太多递归"的错误.

我使用了最新的jQuery和Twitterbootstrap,但仍然有这个问题.

这是显示错误的plunker

你可以找到"Uncaught RangeError:超出最大调用堆栈大小"或"过多的递归"

控制台错误

任何人都知道如何解决它?谢谢

javascript jquery twitter-bootstrap

57
推荐指数
4
解决办法
6万
查看次数

定位ECMAScript 2015模块时,无法使用导入分配

我正在尝试使用以下行:

import Clipboard = require('clipboard');
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

   [default] c:\xampp\htdocs\isitperfect\node_modules\angular2-clipboard\src\clipboard.directive.ts:2:0 
Import assignment cannot be used when targeting ECMAScript 2015 modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.
Run Code Online (Sandbox Code Playgroud)

错误在这一行:

import Clipboard = require('clipboard');
Run Code Online (Sandbox Code Playgroud)

我试过了:

import * as Clipboard from 'clipboard';
Run Code Online (Sandbox Code Playgroud)

和其他一些变化,但无法弄清楚如何解决它.

我正在使用typescript 2.0.0

有任何想法吗?

clipboard typescript angular

26
推荐指数
3
解决办法
2万
查看次数

无法读取配置节'uri',因为它缺少节声明

我尝试使用.net 4.5在IIS7上安装BugNET

它一直在显示

无法读取配置节'uri',因为它缺少节声明

这非常像这个问题而且这个 但是我的应用程序池设置为4.0.

它在.net 4.5的IIS8上工作正常

我认为设置是一样的.

有帮助吗?谢谢

.net asp.net iis-7 web-config

24
推荐指数
2
解决办法
3万
查看次数

Octopress无法使用Code Block构建

我尝试做这样的Octopress代码块

但我不能让它发挥作用.

它始终显示以下错误.我的机器是Windows 7.

$ rake generate
## Generating Site with Jekyll
unchanged sass/screen.scss
Configuration from d:/MyProject/Git/octopress/_config.yml
Building site: source -> public
Liquid Exception: No such file or directory - python c:/Ruby193/lib/ruby/gems/1.
9.1/gems/pygments.rb-0.3.7/lib/pygments/mentos.py in 2013-01-06-octopress.markdo
wn
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:162:in
`spawn'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:162:in
`spawn'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/posix-spawn-0.3.6/lib/posix/spawn.rb:307:in
`popen4'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:41:i
n `start'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:203:
in `mentos'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/pygments.rb-0.3.7/lib/pygments/popen.rb:192:
in `highlight'
d:/MyProject/Git/octopress/plugins/pygments_code.rb:24:in `pygments'
d:/MyProject/Git/octopress/plugins/pygments_code.rb:14:in `highlight'
d:/MyProject/Git/octopress/plugins/code_block.rb:82:in `render'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:94:in `bloc
k in render_all'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `coll
ect'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:92:in `rend
er_all'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/block.rb:82:in `rend
er'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:124:in `
render'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/liquid-2.3.0/lib/liquid/template.rb:132:in `
render!'
c:/Ruby193/lib/ruby/gems/1.9.1/gems/jekyll-0.12.0/lib/jekyll/convertible.rb:79:i
n …
Run Code Online (Sandbox Code Playgroud)

jekyll jekyll-extensions octopress

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

Identity Server +离子+ OpenID混合流程

我找不到这种解决方案的任何例子.它可行吗?据我所知,它应该是,但我没有看到有人这样做.这种方式有什么缺点吗?

谢谢 !

openid ionic-framework identityserver3 ionic2 identityserver4

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

AngularJS + highlight.js(用指令中的表达式计算字符串)

我正在尝试创建一个highlight.js指令,我在使用范围变量时遇到问题.

<script src="http://code.jquery.com/jquery-1.8.2.min.js" ></script>
<link rel="stylesheet" href="http://yandex.st/highlightjs/7.3/styles/default.min.css">
<script src="http://yandex.st/highlightjs/7.3/highlight.min.js"></script>

<div ng-app="app">
    <div ng-controller="MyCtrl">
        <snippet>&lt;script src=&quot;{{src}}&quot;&gt;&lt;/script&gt;</snippet>
        {{src}}
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

function MyCtrl($scope) {
  $scope.src = "foo.js";   
}

app.directive('snippet', ['$timeout', function($timeout) {
    var template = '<pre><code></code></pre>';

    return {
        restrict: 'E',
        compile: function(tElement, tAttrs, transclude) {

            var rawCode = tElement.text();
            tElement.html(template);

            return function(scope, element, attrs) {
                $timeout(function() {
                    scope.$apply(function() {
                        var formattedCode = hljs.highlightAuto(rawCode);
                        $(element).find('code').html(formattedCode.value);
                    });
                }, 0);
            }
        }
    }
}]);?
Run Code Online (Sandbox Code Playgroud)

这是小提琴:http://jsfiddle.net/dkrotts/RE7Jj/5/

如您所见,$ scope.src未在代码段内应用其值.我究竟做错了什么?

javascript angularjs

6
推荐指数
2
解决办法
6233
查看次数

尝试调用自定义过滤器导致'错误TS2349:无法调用其类型缺少调用签名的表达式'

我试图从Angular控制器调用自定义过滤器但我收到错误:'无法调用其类型缺少调用签名的表达式'.

我在上一个项目中就这样实现了它,所以我不知道出了什么问题.

此时过滤器不包含任何逻辑,因为我需要先进行编译.

这是过滤器:

/// <reference path="../../typings/reference.ts" />

module app {
'use strict';

/**
 * Filter models
 */
export class ModelFilter {
    public static Factory() {
        return function(input: string) {
            console.log(input);
            return input;
        }
    }
}

angular.module('app')
    .filter('modelFilter', [ModelFilter.Factory]);
}
Run Code Online (Sandbox Code Playgroud)

和控制器所在的地方:

/// <reference path="../../typings/reference.ts" />

module app {
'use strict';

interface ISearchController {
    vehicles: IVehicles;
    models: any;
    setVehicles(): void;
    updateModels(make: string): void;
}

class SearchController implements ISearchController {

    static $inject = [
        'VehicleMakeService',
        'VehicleModelService',
        '$filter'
    ];
    constructor(private vehicleMakeService: VehicleMakeService,
                private …
Run Code Online (Sandbox Code Playgroud)

angularjs typescript angularjs-filter

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

如何在NLog中设置isdebugenabled

我试图找到一种方法在配置文件中设置isdebugenabled false或true,

所以我可以随时打开或关闭它.谢谢 !

asp.net nlog

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

使用Linq和Group by将数据表转换为对象

我尝试将datatable转换为特殊格式的JSON

DataTable中的数据如下

col1 col2 col3 col4
---------------------
 A    B    c    D1
 A    B    c    D2
 A    B    c    D3
Run Code Online (Sandbox Code Playgroud)

尝试将其转换为对象数组

class obj {
 var col1;
 var col2;
 var col3;
 list<string> col4;
}
Run Code Online (Sandbox Code Playgroud)

我尝试使用linq,但有点卡住了.

 var result = from row in dt.AsEnumerable()
                         group row by new
                         {
                             c1 = row["col1"],
                             c2 = row["col2"],
                             c3 = row["col3"]
                         }
                             into section
                             select new
                                 {
                                     item = section.Key

                                 };
Run Code Online (Sandbox Code Playgroud)

c# linq

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

ngRepeat中的指令时绑定问题

所以这就是它的样子,这里是Plunker

parent scope 
   ng-repeat
       directive
Run Code Online (Sandbox Code Playgroud)

在指令中,有一个属性是与父作用域中的变量进行双向绑定.

但这并不像我想的那样有效.(但我能理解为什么它不起作用)

原因是ngRepeat将创建它自己的范围,因此一旦在指令中更改变量,Angular会在ngRepeat中添加一个变量,但它会使变量保持在父变量中.

我可以做一些像scope.$ parent.$ parent.variable来改变变量,但它在Angular中不是一个想法.

我应该怎么做 ?

此外,如果我更改项目集合中的重复项目,则无法更改项目.

因为上面的原因相同.

angularjs

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

Http.post错误:map不是Angular 2中的函数

我正试图通过http.post函数从url获取数据.但是我收到了错误.app.component.ts文件的源代码:

import {Component} from 'angular2/core';
import {bootstrap} from 'angular2/platform/browser';
import {Http, HTTP_PROVIDERS, Headers} from 'angular2/http';
@Component({
selector: 'my-app',
template: `
 <div>
  <button (click)="postData()">Post Data</button>
  <p>Posted the following values:</p>
  <div>{{postResponse.id}}</div>
  <div>{{postResponse.name}}</div>
 </div>`
})
export class AppComponent {
 result: Object;
 http: Http;
 postResponse = new Person();

 constructor(http: Http) {
    this.http = http;
 }

 postData(){
    var headers = new Headers();
    headers.append('Content-Type', 'application/json');

    this.http.post('http://141.79.39.454:8008/the-link-something-like-this...', JSON.stringify({"id": 1, "name": "?????"}),{headers:headers})
    .map(res => res.json())
    .subscribe((res:Person) => this.postResponse = res);
 }
}

class Person{
 id:number;
 name:string;
}

bootstrap(AppComponent, …
Run Code Online (Sandbox Code Playgroud)

angular

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

使用反射和linq对数据进行对象化

我有这样的数据表

Name| Value
----|------
NA  |  VA
NB  |  VB
NC  |  VC1
NC  |  VC2
ND  |  VD1
ND  |  VD2
Run Code Online (Sandbox Code Playgroud)

和这样的一个类

Class NVMapping {
  List<string> NC { get; set; }
  List<string> ND { get; set; }
  string NA { get; set; }
  string NB { get; set; }
}
Run Code Online (Sandbox Code Playgroud)

如何使用linq或其他方式将数据表传输到此类型?

我想我需要在这里强调一件事.这种映射在我的应用程序中将会很多.

不知怎的,我认为使用反射可以使这个函数是通用的,以处理所有这些有点映射.

所以,如果可能的话,我更喜欢使用泛型函数来实现这一点.

如果可能的话,将数据表转移到像上面转换的对象中更好.

谢谢 !

c# linq reflection datatable

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