我是ng-admin的绿色手,问题是: 是否可以连接到远程服务器以获取数据?比如。
var admin = nga.application(' QDNS Admin') .baseApiUrl(' http://remote主持人/');
非常感谢提前
答案 0 :(得分:0)
在您的admin.js文件中,您必须像这样配置您的API端点:
myApp.config(['NgAdminConfigurationProvider', function (nga) {
// create an admin application
var admin = nga.application('Name of your Admin')
.baseApiUrl('http://localhost:8080/api/');
//if you have an entity called users
nga.configure(admin);
}
答案 1 :(得分:0)
在您的admin.js文件中,您必须像这样配置您的API端点:
myApp.config(['NgAdminConfigurationProvider', function (nga) {
// create an admin application
var admin = nga.application('Name of your Admin')
.baseApiUrl('http://localhost:8080/api/');
//if you have an entity called users
// the API endpoint for this entity will be 'http://localhost:8080/api/users/
var user = nga.entity('users').identifier(nga.field('_id'));
user.listView()
.fields([
nga.field('username'),
nga.field('email'),
nga.field('password'),
nga.field('lastname'),
nga.field('firstname'),
nga.field('created_at'),
nga.field('updated_at')
]);
admin.addEntity(user);
nga.configure(admin);
}
在您的server.js中,您必须定义一个路径