using decorators to write AngularJS in nearly identical syntax to Angular 2
This commit is contained in:
parent
8e863b8cf5
commit
c60ce4a696
19 changed files with 559 additions and 488 deletions
32
static/js/services/page/page.service.ts
Normal file
32
static/js/services/page/page.service.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
/**
|
||||
* Manages the creation and retrieval of pages (route + controller)
|
||||
*/
|
||||
export abstract class PageService implements ng.IServiceProvider {
|
||||
|
||||
/**
|
||||
* Create a page.
|
||||
* @param pageName The name of the page.
|
||||
* @param templateName The file name of the template.
|
||||
* @param controller Controller for the page.
|
||||
* @param flags Additional flags passed to route provider.
|
||||
* @param profiles Available profiles.
|
||||
*/
|
||||
public abstract create(pageName: string,
|
||||
templateName: string,
|
||||
controller?: any,
|
||||
flags?: any,
|
||||
profiles?: string[]): void;
|
||||
|
||||
/**
|
||||
* Retrieve a registered page.
|
||||
* @param pageName The name of the page.
|
||||
* @param profiles Available profiles to search.
|
||||
*/
|
||||
public abstract get(pageName: string, profiles: any[]): any[] | null;
|
||||
|
||||
/**
|
||||
* Provide the service instance.
|
||||
* @return pageService The singleton service instance.
|
||||
*/
|
||||
public abstract $get(): PageService;
|
||||
}
|
Reference in a new issue