小编Kir*_*mar的帖子

Angular 2(更改)用于文件上载

我正在使用Angular 2(更改)来检测上传的文件并触发该功能.但是当我尝试再次上传同一个文件时,我遇到了问题,因为文件没有变化,(触发)没有变化.在这种情况下,请建议事件绑定.

<input type="file" name="file" id="fileupload" (change)="onChange($event)"/>
Run Code Online (Sandbox Code Playgroud)

有没有办法将类型文件的输入值重置为空.

html5 angular2-template angular

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

具有角度2的Bootstrap进度条

我使用bootstrap来显示进度条.要更改进度条中的值,我使用的是Angular 2属性绑定.

<div class="progress">
  <div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" [attr.aria-valuenow]="progress" aria-valuemin="0" aria-valuemax ="100" 
  style="min-width: 2em;" [style.width]="(progress/100)*100 + '%'">
   {{progress}}%
  </div>
Run Code Online (Sandbox Code Playgroud)

当我上传文件时,变量进度将会增加,我可以在控制台日志中看到这些值.

this.service.progress.subscribe(
data => {
    console.log('progress = '+data);
    this.progress = data;
    console.log(this.progress) ;
  });
Run Code Online (Sandbox Code Playgroud)

问题:进度条显示0,然后在上传完成后显示100,它没有进展或显示在值之间.请建议.

twitter-bootstrap angular

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

Windows Server 中的 Spring Boot 应用程序

我计划在 Windows 服务器中部署一个基于 spring boot 的 Web 应用程序。

我想使用 tomcat 容器。

可以直接部署spring boot fat jar还是建议部署war文件。

请建议如何部署和首选方法?

java tomcat windows-server spring-boot

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

webjar 未在 Spring Boot 应用程序中加载

Spring Boot 应用程序中没有jscss没有从 webjar 加载。我添加了所需的依赖项,并且可以看到 jars。

<script src="webjars/core-js/client/shim.min.js"></script>
<script src="webjars/zone.js/dist/zone.js"></script>
<script src="webjars/reflect-metadata/Reflect.js"></script>
<script src="webjars/systemjs/dist/system.src.js"></script>
Run Code Online (Sandbox Code Playgroud)

这给出了 404 错误,我还添加了以下配置来解决此问题,但仍然没有用。

    @Configuration
    @EnableWebMvc

        public class WebConfig extends WebMvcConfigurerAdapter {

            public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
                configurer.enable();
            }

            @Override
            public void addResourceHandlers(ResourceHandlerRegistry registry) {
                registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
                registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
            }


        /*  *//**
           * 
           * @return ViewResolver
           */
            @Bean
            public ViewResolver getViewResolver() {
                InternalResourceViewResolver resolver = new InternalResourceViewResolver();
                resolver.setPrefix("/");
                resolver.setSuffix(".html");
                return resolver;
            }
Run Code Online (Sandbox Code Playgroud)

我的POM

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.abc.xyz</groupId>
    <artifactId>myapp</artifactId>
    <version>0.0.1-SNAPSHOT</version> …
Run Code Online (Sandbox Code Playgroud)

java webjars spring-boot

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

Angular 2 DatePicker仅包含月份和年份

我目前正在使用https://github.com/kekeh/mydatepicker作为我的Angular 2应用程序的日期选择器.我想要一个日期选择器,它只显示角度为2的月份和年份.是否有人知道如何操作.我尝试角度2的Jquery,但没有成功.

jquery jquery-ui-datepicker bootstrap-datepicker angular

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