小编Mot*_*lly的帖子

如何在angularjs中拆分多个js文件中的单个控制器

我正在重写一个从silver-light到angularjs的大型应用程序,同时这样做,我意识到我的每个控制器js文件都跨越2000-3000行代码.我的所有代码都严重依赖于范围变量.想知道是否有机会将单个控制器js文件拆分成多个js文件?任何指针都会受到赞赏.

controllers angularjs

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

控制台应用程序的应用程序洞察不起作用

我已经在博客https://azure.microsoft.com/en-us/documentation/articles/app-insights-windows-desktop/上创建了一个带有AI的基本控制台应用程序,但是在我的Azure帐户的AI中没有捕获指标.也没有报告任何错误/异常.我在这里错过了什么吗?下面是代码.有一些文档说HockeyApp是捕获通过应用程序商店提供的Windows应用程序指标的新方法,但是没有足够的信息用于控制台或Windows服务.你能分享一下你的经历吗?

using System;
using Microsoft.ApplicationInsights;
namespace Logger
{
   class Program
   {
        static void Main(string[] args)
        {
            TelemetryClient tc = new TelemetryClient();
            tc.Context.User.Id = Environment.UserName;
            tc.Context.Session.Id = Guid.NewGuid().ToString();
            tc.Context.Device.OperatingSystem = Environment.OSVersion.ToString();
            tc.TrackPageView("Form1");
            tc.Flush();
            System.Threading.Thread.Sleep(1000);
        }
   }
}
Run Code Online (Sandbox Code Playgroud)

ApplicationInsights.config

<applicationinsights xmlns="http://schemas.microsoft.com/A...">
 <instrumentationkey>
     mykey
 </instrumentationkey>
 <telemetrychannel type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
 <telemetryprocessors>
   <add type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.AdaptiveSamplingTelemetryProcessor, Microsoft.AI.ServerTelemetryChannel">
     <maxtelemetryitemspersecond>5</maxtelemetryitemspersecond>
   </add>
 </telemetryprocessors>
 <telemetryinitializers>
    <add type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer"/>
    <add type="Microsoft.ApplicationInsights.WindowsServer.DomainNameRoleInstanceTelemetryInitializer, Microsoft.AI.WindowsServer"/>
    <add type="Microsoft.ApplicationInsights.WindowsServer.BuildInfoConfigComponentVersionTelemetryInitializer, Microsoft.AI.WindowsServer"/>
  </telemetryinitializers>
  <telemetrymodules>
    <add type="Microsoft.ApplicationInsights.WindowsServer.DeveloperModeWithDebuggerAttachedTelemetryModule, Microsoft.AI.WindowsServer"/>
    <add type="Microsoft.ApplicationInsights.WindowsServer.UnhandledExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
    <add type="Microsoft.ApplicationInsights.WindowsServer.UnobservedExceptionTelemetryModule, Microsoft.AI.WindowsServer"/>
  </telemetrymodules>
  <severity>Verbose</severity>
</applicationinsights>
Run Code Online (Sandbox Code Playgroud)

azure telemetry azure-application-insights

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

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

对齐引导列字段中的文本

我需要使用 bootstrap 在 html 中显示名称值对。我使用类“col-md-1”作为名称和值列,因此数据显示在两列中。问题在于,当 bootstrap 将屏幕分为 12 列时,它在字段值内容的左侧和右侧留下了很多空间。我尝试使用“text-left”、“text-right”类,但它似乎不能与“col-md- ”类一起使用。如何在引导列(例如 col-md- )中将文本向左或向右对齐,而不将样式向左或向右硬编码到某些像素?

   <div class="row">
      <div class="col-md-1">column1</div>
      <div class="col-md-1"><p class="text-right">Name</p></div>
      <div class="col-md-1"><p class="text-left">Value</p></div>
      <div class="col-md-1">column4</div>
      <div class="col-md-1">column5</div>
      <div class="col-md-1">column6</div>
      <div class="col-md-1">column7</div>
      <div class="col-md-1">column8</div>
      <div class="col-md-1">column9</div>
      <div class="col-md-1">column10</div>
      <div class="col-md-1">column11</div>
      <div class="col-md-1">column12</div>
  </div>
Run Code Online (Sandbox Code Playgroud)

text alignment twitter-bootstrap

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