小编Ste*_*eve的帖子

AngularJS ngInclude动态更改其位置

我有一些部分模板,根据用户操作通过ng-click更改位置:

<div ng-include="contentUrl"></div>

<button ng-click="contentUrl = '../partials/testScriptForm.html'">Add Test Script</button>
Run Code Online (Sandbox Code Playgroud)

除非我上面的按钮位于部分内部,否则这很有用,所以如果testScriptForm.html有一个按钮:

<button ng-click="contentUrl = '../partials/testScriptCase.html'">Add Test Case</button>
Run Code Online (Sandbox Code Playgroud)

然后什么都没发生

这似乎是由于ng-include获得了一个新的(继承但未共享的)范围.

我无法想象的是如何获得包含的模板(部分)来改变自己的位置.

我确实尝试了一个函数来改变$ scope.$ parent.contentUrl,它似乎确实改变但没有"传播"这些改变.

在coffeescript中:

  $scope.changeParentLocation = (location) ->
      $scope.$parent.contentUrl = location
Run Code Online (Sandbox Code Playgroud)

还尝试$ scope.$ apply()和$ scope.$ parent.$ apply()在那里得到错误:

错误:[$ rootScope:inprog] http://errors.angularjs.org/1.2.0rc1/ $ rootScope/inprog?p0 =%24apply

也许我只是误用了包括......

angularjs angularjs-scope

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

Groovy/Grails通过HTTP发布XML(使用REST插件)

我正在尝试HTTP使用基本身份验证将XML字符串发布到WebMethods服务器.我试图使用位于HTTP Builder之上的REST插件.我尝试过一些事情,导致0长度响应.使用Firefox海报我使用了完全相同的XML和用户身份验证,WebMethods响应是用一些额外的信息回显请求,所以我在下面的代码中做的是错误的.希望有人有一个指针来执行XML的HTTP Post.

string orderText = "<item>
  <item>1</item>
  <price>136.000000</price>
</item>"


def response = withHttp(uri: "https://someserver.net:4433") {
      auth.basic 'user', 'pass'

          //  have tried body: XmlUtil.serialize(orderText)
      def r = post(path: '/invoke/document', body: orderText, contentType: XML, requestContentType: XML)
        { resp, xml ->
          log.info resp.status
          log.info resp.data
          resp.headers.each {
            log.info "${it.name} : ${it.value}"
          }
        }
     log.info r
     return r   
}
Run Code Online (Sandbox Code Playgroud)

日志说:

04-02-2011 14:19:39,894 DEBUG HTTPBuilder - Response code: 200; found handler:    OrdersService$_closure1_closure2_closure3_closure4@36293b29
04-02-2011 14:19:39,895  INFO HTTPBuilder - Status: 200
04-02-2011 14:19:39,896  INFO HTTPBuilder - …
Run Code Online (Sandbox Code Playgroud)

grails groovy post http

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

自定义Grails环境的行为

我想要运行一个名为"local"的自定义环境......就像在本地开发中一样.在将战争部署到"共享"开发服务器之前,我会使用此配置(例如数据库连接).但我注意到它缺少标准Grails"开发"环境的行为,例如刷新浏览器时无法使用GSP更改.

所以这让我想知道你如何改变自定义环境的行为?如何将"开发"的所有设置复制到另一个环境?

grails

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

Grails抛出表"xxx"未找到

在Grails中,我可以在BootStrap中的内存dataSource中创建域对象,并将结果恢复正常,但是一旦应用程序启动(例如从GSP或控制器查询),我尝试运行查询,我得到:

org.h2.jdbc.JdbcSQLException: Table "FUNCTIONAL_DOC_TYPE" not found; SQL statement:
select this_.id as id1_0_, this_.version as version1_0_, this_.direction_id as direction3_1_0_, this_.functional_group_id as functional4_1_0_, this_.type_name as type5_1_0_ from functional_doc_type this_ [42102-147]
 at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)
 at org.h2.message.DbException.get(DbException.java:167)
 at org.h2.message.DbException.get(DbException.java:144)
 at org.h2.command.Parser.readTableOrView(Parser.java:4562)
 at org.h2.command.Parser.readTableFilter(Parser.java:1020)
 at org.h2.command.Parser.parseSelectSimpleFromPart(Parser.java:1622)
 at org.h2.command.Parser.parseSelectSimple(Parser.java:1729)
 at org.h2.command.Parser.parseSelectSub(Parser.java:1616)
 at org.h2.command.Parser.parseSelectUnion(Parser.java:1461)
 at org.h2.command.Parser.parseSelect(Parser.java:1449)
 at org.h2.command.Parser.parsePrepared(Parser.java:401)
 at org.h2.command.Parser.parse(Parser.java:275)
 at org.h2.command.Parser.parse(Parser.java:247)
 at org.h2.command.Parser.prepare(Parser.java:201)
 at org.h2.command.Parser.prepareCommand(Parser.java:214)
 at org.h2.engine.Session.prepareLocal(Session.java:425)
 at org.h2.engine.Session.prepareCommand(Session.java:374)
 at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1056)
 at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:71)
 at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:233)
 at org.apache.commons.dbcp.DelegatingConnection.prepareStatement(DelegatingConnection.java:281)
 at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.prepareStatement(PoolingDataSource.java:313)
 at org.grails.datastore.gorm.GormStaticApi.findAll(GormStaticApi.groovy:374)
Run Code Online (Sandbox Code Playgroud)
  • 我已经清理了构建

  • 运行Grails 2.0.0

  • 我有多个数据源到SQL服务器DB,它们只调用StoredProcedures,现在发现一个用例,使用好的旧Domain对象在内存存储中使用H2 …

grails hibernate h2

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

标签 统计

grails ×3

angularjs ×1

angularjs-scope ×1

groovy ×1

h2 ×1

hibernate ×1

http ×1

post ×1