小编Dav*_*vík的帖子

VS代码 - 花括号前的代码格式化空间

当我在VS代码编辑器中使用autoformat函数时,它在大括号之前插入空格,如下所示:

从:

<Button onClick={this.callMyFunc.bind(this, screenSet.index)}>Add</Button>
Run Code Online (Sandbox Code Playgroud)

至:

<Button onClick={this.callMyFunc.bind(this, screenSet.index) }>Add</Button>
Run Code Online (Sandbox Code Playgroud)

从:

))}
Run Code Online (Sandbox Code Playgroud)

至:

)) }
Run Code Online (Sandbox Code Playgroud)

我找不到选项这个设置...有人可以帮帮我吗?

reactjs visual-studio-code

12
推荐指数
3
解决办法
3817
查看次数

从嵌套指令的指令访问控制器范围

请看我的小提琴,并帮助我找到一种从嵌套指令"选择"访问函数myAlert的方法.找到了一些解决方案,其中共享了一些范围的属性,如:http://jsfiddle.net/zbD95/6/但我需要使用范围内的函数和属性.

谢谢!!!

这是我的小提琴的重复:小提琴的HTML部分:

<!doctype html>
<html ng-app="plunker" >
<head>
  <meta charset="utf-8">
  <title>AngularJS Plunker</title>
  <link rel="stylesheet" href="style.css">
</head>
<body ng-controller="MainCtrl">
  <choice-tree ng-model="myTree"></choice-tree>  
  <hr />
  <!--$scope.myTree = {{myTree | json}}-->
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

JS小提琴的一部分:

var app = angular.module('plunker', []);

function Choice(name, children) {
  this.name = name;
  this.checked = false;
  this.children = children || [];
}

var apparel = new Choice('Apparel', [
  new Choice('Mens Shirts', [
    new Choice('Mens Special Shirts'),
  ]),
  new Choice('Womens Shirts'),
  new Choice('Pants')
]);
var …
Run Code Online (Sandbox Code Playgroud)

angularjs

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

在将一些html附加到DOM后初始化AngularJS控制器

有没有办法如何从纯JavaScript使用$ compile?我正在组合基本的javascript和我正在使用Angular的地方,并且找不到如何做这样的事情的方法:http://jsfiddle.net/DavidSlavik/bFdcJ/1/

我想我需要使用$ compile但是从没有任何范围的地方.

angular.module('myApp', []);

function ExpensesCtrl($scope) {

    // Here are some master functions...    

}    


$(function () {

   // Here is the Ajax function that returns html from my MVC action processed with Razor
   // Here I'm not using AngularJS and scopes...
   var htmlFromAjax = '<div id="mapOrder" ng-controller="sortable"><div ng-repeat="item in SortItems">{{item.Title}}</div></div>';
   $('body').append(htmlFromAjax);

});

function sortable($scope, $http, $element) {

    // Here is the Ajax function that return JSON object. For example it is commented and used static …
Run Code Online (Sandbox Code Playgroud)

angularjs

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

如何获取Kendo UI Editor内容的选定值

我需要插入自定义编辑器工具来将链接插入到富文本中.它应该作为编辑器中的基本链接插入,但在对话窗口中我需要使用我们的文档结构的树视图来选择链接目标.

请问您能帮助我获取编辑内容的选定文本的语法吗?

最好的问候大卫

kendo-ui

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

刷新AngularJS中的可观察对象

我正在使用AngularJS,无法找到解决此问题的方法:

我的控制器有一部分:

$scope.$on('showMoreNotifications', function (event) {
    $.ajax({
        url: '/notifications',
        data: {
            notificationCount: 30
        },
        success: function (e) {
            $scope.notifications = e.Messages;
        }
    });
});
Run Code Online (Sandbox Code Playgroud)

这是使用此控制器的html:

<div class="widget" id="widget-notifications" ng-controller="NotificationsCtrl">
    <span class="title" ng-click="$parent.$broadcast('showMoreNotifications')">@*showMoreNotifications()*@
        Notifikace
    </span>
    <div class="messages">
        <div ng-repeat="item in notifications" class="message-item type-{{item.Entity}}" data-id="{{item.AuditLogId}}">
            <span class="type"></span>
            <div class="description">
                <span class="date">{{item.Date}}</span> / {{item.Message}}
            </div>
        </div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

如果我点击顶部的span类标题,控制器右键调用服务器并接收JSON数据.不幸的是,不要刷新与之相关的html.当我第二次点击时,html刷新第一次请求的数据.

angularjs

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

NetworkError:SignalR集线器上的500内部服务器错误

当我在本地计算机上运行该网站时,它可以正常工作,但是当我上传到我的域时,它开始生成此错误.我在差异服务器上的两个应用程序上遇到同样的问题.同样只是实现解决方案,什么是ASP.Net MVC 3,C#.我的两个应用程序都运行在IIS服务器上的"完全信任"保护.在本地它工作正常但问题出在远程服务器上.

应用程序运行正常,但返回错误:(这是mozilla firebug/network的截图.

在此输入图像描述

asp.net-mvc signalr signalr-hub

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