Which works fine, I now have a new section with a blank page, my question now is how can I put data in that section? I just want to write a query to the database to display some content in a table on that section.
First, I'd consider whether you are re-inventing the wheel. There's a great package from Matt Brailsford that makes creating custom sections with data in them really easy to create - see https://umco.github.io/umbraco-fluidity/
If you really want to go it alone then you're going to need a Web API controller and some understanding of how you can use Umbraco's PetaPoco implementation to get data from the database and serialise it as JSON for use in AngularJS views.
So you'll probably need a UmbracoAuthorizedJsonController then within this controller you can use UmbracoContext.Application.DatabaseContext.Database to access the Umbraco database. You'd then execute a query to return your data and return it from your controller, where it will be automatically serialised to JSON. You can then access this JSON in your Angular view.
Here's an example of a controller I've used in a custom section:
Creating custom page
Hello all,
I've followed the below example to create a new section;
http://jondjones.com/learn-umbraco-cms/umbraco-developers-guide/customising-umbraco-ui/how-to-create-a-custom-section-in-umbraco-7
Which works fine, I now have a new section with a blank page, my question now is how can I put data in that section? I just want to write a query to the database to display some content in a table on that section.
First, I'd consider whether you are re-inventing the wheel. There's a great package from Matt Brailsford that makes creating custom sections with data in them really easy to create - see https://umco.github.io/umbraco-fluidity/
If you really want to go it alone then you're going to need a Web API controller and some understanding of how you can use Umbraco's PetaPoco implementation to get data from the database and serialise it as JSON for use in AngularJS views.
https://our.umbraco.org/Documentation/Implementation/Controllers/
So you'll probably need a
UmbracoAuthorizedJsonController
then within this controller you can useUmbracoContext.Application.DatabaseContext.Database
to access the Umbraco database. You'd then execute a query to return your data and return it from your controller, where it will be automatically serialised to JSON. You can then access this JSON in your Angular view.Here's an example of a controller I've used in a custom section:
https://github.com/DanDiplo/Umbraco.AuditLogViewer/blob/master/Diplo.AuditLogViewer/Controllers/AuditLogController.cs
Here's an example of returning paged data from the database using PetaPoco:
https://github.com/DanDiplo/Umbraco.AuditLogViewer/blob/master/Diplo.AuditLogViewer/Services/LogService.cs
The Angular stuff is in:
https://github.com/DanDiplo/Umbraco.AuditLogViewer/tree/master/Umbraco/App_Plugins/DiploAuditLogViewer/backoffice/diploAuditLog
is working on a reply...