custom types
in a custom page
Hello everyone.
My site is build from the MeanJS, and I want to integrate the ng-admin as a part of my site. But I failed.
And I did a test like this:
// Init the application configuration module for AngularJS application
var ApplicationConfiguration = (function () {
// Init module configuration options
var applicationModuleName = 'ang_html';
var applicationModuleVendorDependencies = ['ui.router', 'ng-admin'];
// Add a new vertical module
var registerModule = function (moduleName, dependencies) {
// Create angular module
angular.module(moduleName, dependencies || []);
// Add the module to the AngularJS configuration file
angular.module(applicationModuleName).requires.push(moduleName);
};
return {
applicationModuleName: applicationModuleName,
applicationModuleVendorDependencies: applicationModuleVendorDependencies,
registerModule: registerModule
};
})();
angular.module(ApplicationConfiguration.applicationModuleName, ApplicationConfiguration.applicationModuleVendorDependencies);
angular.element(document).ready(function () {
angular.bootstrap(document, [ApplicationConfiguration.applicationModuleName])
});
ApplicationConfiguration.registerModule('newApp1', []);
angular
.module('newApp1')
.config(routeConfig)
.config(['NgAdminConfigurationProvider', function (NgAdminConfigurationProvider) {
// create the admin application
var admin = NgAdminConfigurationProvider.application('My First Admin')
.baseApiUrl('/xxx');
NgAdminConfigurationProvider.configure(admin);
}]);
routeConfig.$inject = ['$stateProvider'];
function routeConfig($stateProvider) {
$stateProvider
.state('order', {
abstract: true,
url: '/order',
template: '<ui-view/>'
})
.state('order.admin', {
url: '',
template: '<div ui-view="ng-admin">AAAA</div>',
data: {
}
});
}
This does not work.
And I created a repo for my test: test ng -admin can someone help me ?
taskDevelopers.config(['RestangularProvider', function(RestangularProvider) {
var login = 'admin',
password = 'xxx',
token = window.btoa(login + ':' + password);
RestangularProvider.setDefaultHeaders({'Authorization': 'Basic ' + token});
}]);
.targetField
works for display, but I'd like to configure it to post as well
This is the expected markup which is created dynamically
<textarea data-ng-model="cv.experience[content.title]"></textarea>
<textarea data-ng-model="cv.experience[content.title]"></textarea>
This is the sample of the JSON I want to achieve
experience:{
content:[
{
header:String,
title:String,
start_date:Date,
end_date:Date,
location:String,
description:String
},
{
header:String,
title:String,
start_date:Date,
end_date:Date,
location:String,
description:String
},
....
]
}
How can i archive above structure using ** ng-model **
hi,
the following URL is called on our application to add a new subscription record.
http://mydomian.com/Subscriptions/create?defaultValues={"login_id":1234}
Part of the creationview code is the following:
subscription.creationView()
.title('<h4>Subscriptions <i class="fa fa-angle-right" aria-hidden="true"></i> Create: Subscription</h4>')
.fields([
nga.field('login_id', 'reference')
.targetEntity(admin.getEntity('LoginData'))
.targetField(nga.field('username'))
.attributes({ placeholder: 'Select Account' })
.validation({ required: true })
.singleApiCall(function (login_id) {
return { 'login_id[]': login_id };
})
.label('Username'),
The API call to the LoginData entity is bringing back all the records; what we want is to pass to the API call the login_id value coming from the initial URL. Something like: http://mydomain.com/api/LoginData?login_id=1234
How do we do that ?