小编Had*_*uli的帖子

Browser-sync TypeError args.cb不是函数

我在gulp任务中使用浏览器同步,例如:

gulp.task('gulp-task',function(){
    browserSync.init({
        server:{
            baseDir: 'app'
        }
    }) 
    //rest of task 
 });
Run Code Online (Sandbox Code Playgroud)

我在gulp watch中使用这个gulp任务(例如)app/**/*.html像:

gulp.task('watch',function(){
    gulp.watch('app/**/*.html', ['gulp-task']);
});
Run Code Online (Sandbox Code Playgroud)

首次更改html文件一切正常,但对于下一次更改我得到错误: TypeError: args.cbn is not a function ...

伙计们说用以下命令安装浏览器同步的最新版本:

npm install browser-sync@latest --save-dev
Run Code Online (Sandbox Code Playgroud)

它没有帮助.

我收到同样的错误.怎么了?

npm gulp gulp-watch browser-sync

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

禁用ngbDatepicker输入

我正在使用ngbDatepickerng2-datepicker-jalali。我使用ngbDatepicker如下指令:

   <div class="input-group" dir="ltr">
      <input class="form-control" 
          placeholder="yyyy/m/d" 
          name="dp" 
          [(ngModel)]="registerDate" 
          ngbDatepicker 
          [firstDayOfWeek] = "6"
          [disabled]="disabled"
          #d="ngbDatepicker" >
          <button class="input-group-addon" (click)="d.toggle()" type="button">
              <i class="fa fa-calendar"></i>
          </button>
    </div>
Run Code Online (Sandbox Code Playgroud)

我正在尝试禁用输入以从datepicker强制选择日期。 [disabled]="disabled"attr禁用整个日期选择器。

angular2-forms angular2-directives ng-bootstrap angular

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

更改Hibernate 5命名策略+Spring Boot+注解

JPA我的 spring boot 项目在实体类中使用hibernate 注解。我有自己的通用存储库,并且我NOT从 JPA 的entityManagerFactory 获取Hibernate SessionFactory。创建新表和列时会出现此问题。Camel 列在数据库上创建时带有下划线。我将命名策略更改为org.hibernate.cfg.EJB3NamingStrategyinapplication.yml但没有任何修复。

应用程序.yml:

 jpa:
    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect 
    show-sql: true 
    hibernate:
        ddl-auto: update 
        naming-strategy: org.hibernate.cfg.EJB3NamingStrategy
Run Code Online (Sandbox Code Playgroud)

在我自己的通用存储库中获取休眠会话(不使用EntityManager):

@Autowired
public SessionFactory   sessionFactory;

public Session getSession() {
    try {
        return sessionFactory.getCurrentSession();
    } catch (HibernateException e) {
        System.out.println(e.getMessage().toString());
    }
    return sessionFactory.openSession();
}
Run Code Online (Sandbox Code Playgroud)

我曾经创建一个自定义的命名策略扩展,ImplicitNamingStrategyJpaCompliantImpl但什么也没发生!

怎么了?

What I want:

在数据库中用骆驼创建的列。甚至桌子!

hibernate spring-boot

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

无法读取HTTP消息:org.springframework.http.converter.HttpMessageNotReadableException:缺少必需的请求正文

我有和拦截器,由于某些原因,我必须阅读包含在HttpServletRequest这里的POSTED日期:

    InputStream inputStream = request.getInputStream();
    if (inputStream != null) {
        bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        char[] charBuffer = new char[128];
        int bytesRead = -1;
        while ((bytesRead = bufferedReader.read(charBuffer)) > 0) {
            stringBuilder.append(charBuffer, 0, bytesRead);
        }
    } else {
        stringBuilder.append("");
    }
Run Code Online (Sandbox Code Playgroud)

在这个动作之后我得到了400个关于ajax的错误请求无法读取HTTP消息: org.springframework.http.converter.HttpMessageNotReadableException: Required request body is missing

spring interceptor

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