小编Kiw*_*iwi的帖子

CSS不能在AngularJS中动态更新

我试图通过angularJS值(0 - 100)设置宽度为2的div,所以我这样做了:

<span class="green" ng-style="{width: '{{videoRating}}%'}"</span>
<span class="red" ng-style="{width: '{{100-videoRating}}%'}"></span>
Run Code Online (Sandbox Code Playgroud)

但宽度是根据videoRating的初始值计算的.当我更改该值时,它不会更新样式.

有关如何做到这一点的任何建议?

我尝试添加ng-cloak,$scope.$apply()但没有运气

javascript css angularjs ng-style

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

json访问数据未正确显示

我正在处理一些json编码数据,但我无法正确访问它,这是我做的一些测试:

代码片段1:

var json = [
{"MarkerId":1,"0":1,"UserId":2147483647,"1":2147483647,"locX":51,"2":51,"LocY":4,"3":4},
{"MarkerId":2,"0":2,"UserId":2147483647,"1":2147483647,"locX":55,"2":55,"LocY":4,"3":4}];
console.log(json[0][0]);
Run Code Online (Sandbox Code Playgroud)

输出:

1

代码片段2:

var json2 = getCookie('markers');
console.log(json2[0][0]);
Run Code Online (Sandbox Code Playgroud)

输出:

[

代码片段3:

console.log(getCookie('markers'));
Run Code Online (Sandbox Code Playgroud)

输出:

[{"MarkerId":1,"0":1,"UserId":2147483647,"1":2147483647,"locX":51,"2":51,"LocY":4,"3":4},{"MarkerId":2,"0":2,"UserId":2147483647,"1":2147483647,"locX":55,"2":55,"LocY":4,"3":4}]

正如你所看到的,当我使用测试3硬编码的结果时,我可以很好地访问它,但是当我只在代码中使用它时我会得到不同的东西

有谁知道如何做到这一点?

javascript json

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

启动服务上的NLog异常

我正在做一个服务,现在是空的,只使用NLog,但是当我启动服务时,我得到以下错误;

---------------------------
Services
---------------------------
Windows could not start the JobService service on Local Computer.

Error 1053: The service did not respond to the start or control request in a timely fashion.

---------------------------
OK   
---------------------------
Run Code Online (Sandbox Code Playgroud)

这是事件查看器中的堆栈跟踪:

Application: service.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Configuration.ConfigurationErrorsException
Stack:
   at System.Configuration.ClientConfigurationSystem.EnsureInit(System.String)
   at System.Configuration.ClientConfigurationSystem.PrepareClientConfigSystem(System.String)
   at System.Configuration.ClientConfigurationSystem.System.Configuration.Internal.IInternalConfigSystem.GetSection(System.String)
   at System.Configuration.ConfigurationManager.GetSection(System.String)
   at NLog.Config.XmlLoggingConfiguration.get_AppConfig()
   at NLog.LogFactory.get_Configuration()
   at NLog.LogFactory.GetLogger(LoggerCacheKey)
   at NLog.LogFactory.GetLogger(System.String)
   at NLog.LogManager.GetLogger(System.String)
   at JobsService.Service1..ctor()
Run Code Online (Sandbox Code Playgroud)

NLog.config:

<?xml version="1.0" encoding="utf-8" ?>
<nlog …
Run Code Online (Sandbox Code Playgroud)

c# windows-services nlog

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

C#按其他列表排序列表

我现在有2个清单:

list<string> names;
list<int> numbers;
Run Code Online (Sandbox Code Playgroud)

我需要根据数字中的值对我的名字进行排序.我一直在搜索,大多数使用像x.ID这样的东西,但我真的不知道那个值是多少.所以这没用.

有谁知道,该做什么,或者可以帮助我在ID部分?

c# sorting

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

.click(function())未被调用

我正在尝试使用last.fm api进行chrome扩展,并且我已经成功地放下了我希望它显示的页面中的fol div.

<div id="showLastFMInfo" Title="More info about song" class="LastFMButtonDown">&raquo;</div>
Run Code Online (Sandbox Code Playgroud)

但当我点击它时,没有任何反应,这是JS使用的:

$(document).ready(function () {
    // this get executed
    $('#meta-frame').append('<div id="showLastFMInfo" Title="More info about song" class="LastFMButtonDown">&raquo;</div>');

    // this won't work if I click on my button
    $("#showLastFMInfo").click(function(){
        console.log("Click");
    });
});
Run Code Online (Sandbox Code Playgroud)

所以你可以看到第一行被执行但.click()没有反应.

这是我的manifest.json:

{
   "content_scripts": [ {
      "js": [ "jquery.js", "lastfm.api.cache.js","lastfm.api.md5.js", "lastfm.api.js","lastFMLink.js", "script.js"],
      "css": [ "LastFMLink.css" ],
      "run_at": "document_end"
   } ],

   "name": "Plug.Dj VS last.Fm",
   "description": "Implement information about the artist",
   "icons": { "16": "cookie.png", "48": "cookie.png", "128": "cookie.png" },
   "version": "0.0.1", …
Run Code Online (Sandbox Code Playgroud)

javascript api jquery last.fm

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

标签 统计

javascript ×3

c# ×2

angularjs ×1

api ×1

css ×1

jquery ×1

json ×1

last.fm ×1

ng-style ×1

nlog ×1

sorting ×1

windows-services ×1