小编Art*_*uro的帖子

无法找到指令'ngMessage'所需的控制器'ngMessages'

嗨我按照jonhpapa规则使用angularjs(1.5.0)开发应用程序.我也使用角度材料1.0.6.

我添加模块'ngMessages'时遇到问题.

我安装了lib angular-messages 1.5.1.

当我添加要使用的模块时,我在控制台上有以下错误.

Error: [$compile:ctreq] Controller 'ngMessages', required by directive 'ngMessage', can't be found!
http://errors.angularjs.org/1.5.0/$compile/ctreq?p0=ngMessages&p1=ngMessage
    at http://localhost:3000/bower_components/angular/angular.js:68:12
    at getControllers (http://localhost:3000/bower_components/angular/angular.js:8817:19)
    at nodeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8982:33)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8226:13)
    at nodeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8973:24)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8226:13)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8229:13)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8229:13)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8229:13)
    at compositeLinkFn (http://localhost:3000/bower_components/angular/angular.js:8229:13) <div data-ui-view="" class="ng-scope">
Run Code Online (Sandbox Code Playgroud)

此时此视图没有控制器.该视图包含:

         <md-input-container>
            <label>First name</label>
            <input name="firstName" 
              ng-model="vm.user.firstName"
              md-maxlength="30" 
              required>
              <div ng-messages="vm.user.firstName.$error">
                <div ng-message="md-maxlength">Field has to be less than 30 characters long.</div>
                <div ng-message="required">Field required</div>
              </div>
          </md-input-container>
Run Code Online (Sandbox Code Playgroud)

在此先感谢,问候.

angularjs angular-material

10
推荐指数
2
解决办法
4830
查看次数

Hibernate - @OneToMany - com.sun.jdi.InvocationException发生了调用方法

我对OneToMany关系有疑问.我正在使用spring-mvc和spring-security以及hibernate 4.

我正在为所有人使用注释.

我的问题是在实体战争中,当我看到atributte List播放器调试时,我看到players= PersistentBag并且当我点击它时com.sun.jdi.InvocationException occurred invoking method.

我也得到了这个例外:

org.apache.jasper.JasperException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: clanwar.model.War.players, could not initialize proxy - no Session

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: clanwar.model.War.players, could not initialize proxy - no Session
Run Code Online (Sandbox Code Playgroud)

实体:

@Entity
@Table(name = "WARS")
public class War implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID", nullable = false)
    private int id;

    @ManyToOne …
Run Code Online (Sandbox Code Playgroud)

java annotations hibernate

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