我安装了基于IDEA ide的新Android Studio 0.1.1,并尝试从Eclipse导入代码.
我探索这个问题,找到了一个弱点:在文件build.gradle中,我改变了下一行:
它解决了我的项目导入问题.我认为这是Eclipse导出功能的问题.构建工具仅从版本17(在ADT 22中)开始,因此找到版本15是不可能的.
使用本指南,我想在Eclipse中使用Gradle构建一个现有项目.
build.grale包含:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.14.0'
}
}
apply plugin: 'android'
android {
buildToolsVersion "19.1.0"
compileSdkVersion 16
}
repositories {
mavenCentral()
}
dependencies {
compile files('libs/android-support-v4.jar')
}
Run Code Online (Sandbox Code Playgroud)
但我得到:
如何解决这个问题?我尝试了几个小时不同的方法,但似乎没有任何工作.
我正在将AngularJS整合到hackathon-starter中.这是我在这里用以下test.html和test.controller.js 提到的
<div>
The record: {{record}}
</div>
<div align="right">
<button class="btn btn-lg btn-primary" ng-click="createRecord()" onclick="window.location.href='/order/shipping'">
<i class=""> Create record</i>
</button>
</div>
Run Code Online (Sandbox Code Playgroud)
test.controller.js
(function () {
'use strict';
var injectParams = ['$scope', '$location', '$http'];
function TestController($scope, $location, $http) {
$scope.record = {
interId: 1,
sku: '107k',
category: 'Useful'
};
function createRecord(record) {
return $http.post('/order/create', record).then(function (response) {
return response.data;
})
}
$scope.createRecord = function () {
var record = $scope.record;
createRecord(record)
.then(function (data) {
if (data.success) {
return $location.url('/shipping'); …
Run Code Online (Sandbox Code Playgroud) 需要查看以下搜索结果:
@Repository
public interface UserRepository extends CrudRepository<User, Long> {
public User findByUsername(String username);
}
Run Code Online (Sandbox Code Playgroud)
我从我的控制器那里打电话:
@RequestMapping(value = "/users/find", method = RequestMethod.GET)
public @ResponseBody User findByUsername(@RequestParam("username") String userName) {
return usersRepo.findByUsername(userName);
}
Run Code Online (Sandbox Code Playgroud)
上述方法通过以下方式调用:
@GET("/users/find")
public User findByUsername(String userName);
Run Code Online (Sandbox Code Playgroud)
班级用户在这里:
@Entity
public class User {
@Id
@GeneratedValue(strategy=GenerationType.AUTO)
private long id;
private String username;
etc...
Run Code Online (Sandbox Code Playgroud)
通过输入例如localhost:8080/users,我可以在浏览器中看到默认方法的结果
我尝试了很多可能的请求,但似乎我错过了一些东西.任何帮助表示赞赏.
如果可能的话,最好将 Jade 中的两个字段相乘。这是我想要完成的:
tbody
each item in items
tr
td #{item.sku}
td.text-center #{item.price}
td.text-center #{item.quantity}
//td #{item.quantity} * #{item.price}
// - var totals = {item.price} * {item.quantity};
//td #{totals}
td #{item.quantity} * #{item.price}
Run Code Online (Sandbox Code Playgroud)
尝试了不同的方法,到目前为止没有人工作。