All Downloads are FREE. Search and download functionalities are using the official Maven repository.

concrete.templates.websocket.angular.code.v1.tspackage.ftl Maven / Gradle / Ivy

There is a newer version: 0.5.3-RC1
Show newest version
<#macro paramList params><#list params as param>${param.name}: ${param.type}<#if param_has_next>, 
<#macro objList params><#list params as param>${param.name}: ${param.name}<#if param_has_next>, 
<#macro importsList classes><#list classes?sort as clazz>${clazz}<#if clz_has_next>, 
<#macro genericList typeVariable><#list typeVariable as clazz>${clazz}<#if clz_has_next>, 
<#if includeServices??>
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';

import { AbstractConcreteService } from '${contextPath}AbstractConcreteService';


<#list imports?sort_by("packageName") as import>
import { <@importsList classes=import.classes/> } from '${contextPath}${import.packageName}';

<#--?sort_by("className")-->
<#list classes as clazz>
<#if clazz.classType == 0>
<#assign module = clazz/>

@Injectable()
export class ${module.className} extends AbstractConcreteService {

    constructor () {
        super();
    }

    <#--protected $$belong(): string {-->
        <#--return <#if module.belong??>'${module.belong}'<#else >null;-->
    <#--}-->

<#list module.methods?sort_by("name") as method>
    public ${method.name}(<@paramList params=method.params/>): Observable<${method.returnType}> {
        return this.send('${method.methodPath}', ${method.body});
    }

}
<#else >
<#assign pojo = clazz/>

export class ${pojo.className}<#if pojo.genericParams?size != 0><<@genericList typeVariable=pojo.genericParams/>><#if pojo.superClass??> extends ${pojo.superClass} {
    <#list pojo.fields?sort_by("name") as field>
    ${field.name}: ${field.type};
    
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy