小编Ada*_*ski的帖子

angularjs - ngRepeat with ngInit - ngRepeat不刷新渲染值

我有使用ngRepeater显示的数组,但是使用此指令我正在使用ngInit指令,该指令执行应返回要显示的对象的函数.一切都很完美,但当我添加"新"按钮,我向数组添加新值,然后函数"SetPreview"只执行一次我认为应该执行函数取决于数组值的数量.我怎样才能做到这一点?

用户界面:

<body ng-app>

  <ul ng-controller="PhoneListCtrl">
      <button ng-click="add()">Add</button>
    <li ng-repeat="phone in phones" ng-init="displayedQuestion=SetPreview(phone);">
      {{displayedQuestion.name}}
      <p>{{displayedQuestion.snippet}}</p>
    </li>
  </ul>
</body>
Run Code Online (Sandbox Code Playgroud)

控制器:

function PhoneListCtrl($scope) {
  $scope.phones = [
    {"name": "Nexus S",
     "snippet": "Fast just got faster with Nexus S."},
    {"name": "Motorola XOOM™ with Wi-Fi",
     "snippet": "The Next, Next Generation tablet."},
    {"name": "MOTOROLA XOOM™",
     "snippet": "The Next, Next Generation tablet."}
  ];

    $scope.add = function(){
        this.phones.push({name:'1', snippet:'n'});
    };        
    $scope.SetPreview = function(phone)
    {
        //here logic which can take object from diffrent location
        console.log(phone);
        return phone;
    }; …
Run Code Online (Sandbox Code Playgroud)

angularjs

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

如何在TeamCity的概述页面上显示msbuild错误

我想将PowerShell与Psake和TeamCity配合使用来配置我的CI.我曾经使用标准的Msbuild运行程序,但现在我编写了自己的脚本来构建解决方案,但是当msbuild失败时我遇到了问题.

当我使用Msbuild runner并且构建失败时,然后在Overview页面上出现新的"Build errors"部分,我有来自msbuild的详细信息.但是当我编写自定义脚本时,我只得到错误"进程退出代码1",我不知道如何"创建"此构建错误部分.你知道怎么做吗?我知道我可以使用服务消息,但我无法处理来自msbuild的失败日志.

task compile {
try {
   exec { msbuild $code_dir\SampleSolution.sln /t:Build /p:Configuration=Release }
} catch {
   Write-Host $_ #only information that error occured, but without any msbui details
} }
Run Code Online (Sandbox Code Playgroud)

powershell psake teamcity-7.1

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

在没有Vistual Studio的构建服务器上每次构建后重新生成T4模板

我的解决方案文件包含许多项目,其中包含许多模板文件,我希望在项目构建之后或之前重新生成每个模板.我知道如何在本地做,但我有问题,该怎么做构建服务器上未安装Visutal工作室.你有任何解决方案吗?

我知道这两个解决方案来自这个源:获取Visual Studio在每个构建上运行T4模板:
a)Visual Studio可视化和建模SDK - 我必须安装visual studio(Express Edition除外),我不能这样做
b )使用TextTransform.exe工具,但后来我在GAC中缺少dll有问题

问候

t4 templates visual-studio

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

使用asp.net webforms的autofac实例无法解析,嵌套生命周期也无法解析

我得到以下异常"实例无法解析,并且无法从此LifetimeScope创建嵌套生命周期,因为它已经被处理掉了." 当我尝试从global.asax Application_EndRequest事件中解析对象时.我在版本2.5.2.830中使用Autofac

public class Global : System.Web.HttpApplication, IContainerProviderAccessor
{
    // Provider that holds the application container.
    static Autofac.Integration.Web.IContainerProvider _containerProvider;

    // Instance property that will be used by Autofac HttpModules
    // to resolve and inject dependencies.
    public Autofac.Integration.Web.IContainerProvider ContainerProvider
    {
        get { return _containerProvider; }
    }
    protected void Application_Start(object sender, EventArgs e)
    {
        var builder = new ContainerBuilder();
...
        _containerProvider = new ContainerProvider(builder.Build());
    }

    protected void Application_BeginRequest(object sender, EventArgs e)
    {
        ISession session = _containerProvider.RequestLifetime.Resolve<ISession>();
        session.BeginTransaction();
    }

    private void Application_EndRequest(object …
Run Code Online (Sandbox Code Playgroud)

autofac

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

从特定的促销构建中复制工件

我在詹金斯有两份工作.第一个名称是"Build",第二个名称是"Deploy to test environment".在第一项工作中,测试人员手动设置升级,然后只能部署升级版本.在第二个工作中,我添加了"Promoted Build Parameter",它使用提升的构建生成组合框,但是我无法将此参数的值与"从另一个项目复制工件"构建步骤连接起来.那么如何从选定的推广构建中复制工件?

continuous-integration promotions jenkins jenkins-plugins

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