我正在响应中从服务器发送自定义标头.在$http
响应拦截器中我想得到这个标题,但我能得到的唯一标题是Content-type
标题.我该如何解决我的问题?
我的$http
拦截器:
response: function (response) {
var AuthToken = response.headers('AuthToken');
return response || $q.when(response);
},
Run Code Online (Sandbox Code Playgroud)
AuthToken
未定义.
我有ngView
三种ngIncluded
观点:搜索过滤器,产品,分页.我想要:
?category=shoes
我开始reloadOnSearch: false
了$routeProvier.when
.现在当我调用$location.search()
函数url更改时,但页面没有重新加载.这就是我想要实现的目标,但当我点击后退按钮时,产品不会重新加载到之前的状态.唯一发生的是改变网址.问题是如何在这种情况下处理后退和下一个按钮事件?
我已经安排了一个带有 annotation 的作业@Scheduled
,它应该使用 spring data jpa 处理数据并将其保存到数据库中。save
调用该方法没有任何异常,但没有插入数据库。在同一个带注释的方法中,我调用了findAll
工作正常并获取数据的方法。可能是什么原因?
@Repository
public interface PossibleOfferLinkRepository extends PagingAndSortingRepository<PossibleOfferLink, Long> {
}
@Configuration
@ComponentScan
@EnableAutoConfiguration
@Import({Scheduler.class})
@EntityScan(basePackages="model_package")
public class Application {
public static void main(String[] args) {
SpringApplication.run(Application.class, args);
}
}
@EnableScheduling
@ConditionalOnProperty(value= "property_name")
public class Scheduler {
...
@Scheduled(fixedRate=100000)
public void scheduleCrawlerJob() throws MalformedURLException {
Iterable<PossibleOfferLink> links = repo.findAll();
PossibleOfferLink link = repo.save(new PossibleOfferLink(new URL("...")));
}
}
Run Code Online (Sandbox Code Playgroud)
马文
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.1.8.RELEASE</version>
</parent>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency> …
Run Code Online (Sandbox Code Playgroud)