no particular reason, just a quick way to have a javascript object similar and (and already with "camelCase" notation) to the server one. Only a way to be less typing error prone
forgive me for my english
good!, i accomplished this configuring the state provider as follow (inside app.js)
.state('poieditor', {
url: '/poieditor/:id', //<--id parameter
templateUrl: '/App/Main/views/poi/editor.cshtml',
menu: 'PoiEditor'
and injecting into the controller the relative "$stateParams" service in order to recover the parameter
var _id = $stateParams.id;
i fond out that the UI Angular router offers a great flexibility this is a nice article (can be useful to someone) [http://www.ng-newsletter.com/posts/angular-ui-router.html])
thanks
Stupid me :roll: Thanks
thanks a lot, here is my project ready to download (with migrations and seed data) [http://www.filedropper.com/fromtemplate])
Are there in your example projects some part that uses the javascript function(the ajax
calls to the services) made for jquery instead of angular? if yes, where? thank 1000 for you kind and active cooperation
Alessio
so i've simplified my repo(se below) to restrict the research field but the problem
persist. the strange thing is that the execution is repeted twice (like in async way)
my ApplicationService (PoiAppService):
public class PoiAppService : ApplicationService, IPoiAppService
{
private readonly IPoiRepository _poiRepository;
public PoiAppService(IPoiRepository poiRepository)
{
_poiRepository = poiRepository;
}
public GetPoisOutput GetPois()
{
var pois = _poiRepository.GetAllPois();
return new GetPoisOutput
{
Pois = Mapper.Map<List<PoiDto>>(pois)
};
}
}
my repository (PoiRepository)
public class PoiRepository : AbpZeroSampleRepositoryBase<Poi, long>, IPoiRepository
{
public PoiRepository(IDbContextProvider<AbpZeroSampleDbContext> dbContextProvider)
: base(dbContextProvider)
{
}
public List<Poi> GetAllPois()
{
var query = GetAll();
query.Where(x=>x.Id == 91); //an existing id, just to test
return query.OrderByDescending(x => x.Name).ToList();
}
}
i've notice also that: in the browser's developer tool, the script "GetAll.js" is
downloaded 2 times, sholud it be unique, really? In an old example project "SimpleTaskProject" i see only one "GetAll.js" (the only
difference is that my project has ModuleZero installed (from the template) is this script generated on applicationLayer basis? how can i investigate deeply?
thanks a lot, i didn't know the existance of this class!
you're right i've duplicated the DbSet's
so now i got this error on the Account/Login
There should be a 'Default' tenant if multi-tenancy is disabled!
where i should provide this default value? in the model? in the seed method? directly into the db?
Good!
i did so, but i don't like
in the application layer
public DeleteDocumentOutput DeleteDocument(DeleteDocumentInput input)
{
var document = _documentRepository.FirstOrDefault(input.Id);
if (document == null)
{
throw new Exception("Can not found the document!");
}
_documentRepository.Delete(document);
return new DeleteDocumentOutput
{
Id = document.Id //<----
};
}
in the angular controller
documentService.deleteDocument({
id: document.id
}).success(function(value) {
vm.documents.forEach(function (element, index, array) {
if (element.id === value.id) {
vm.documents.splice(index,1);
}
});
vm.refreshDocuments();
});
could i do it better?
yep, it was cache browser fault :-/ thanks