Here you can find some useful decorators written in Typescript 2 for angular 1 project.
To help you out with the new semantic of angular 2 components I wrote some simple decorators in Typescript
Below you will find useful examples of the different decorators
export let moduleName = 'service.module'
@Service({
module: moduleName, // name of the angular module where you would like to attach this service,
serviceName: 'yourServiceName' // then name under which this service will be injected
})
export class YourNewService{
}
export let moduleName = 'component.module';
@Component({
selector: 'httml-selector', // the name of your html-element
module: moduleName , //name of the angular module where you would like to attach this component ,
template: require('./your.template.html') // the template you want to use
})
export class YourComponentController {}
expot let moduleName = 'filter.module'
export class YourFilterClass {
@Filter({
filterName: 'filter1',
module: moduleName
})
public filter1() {
return (input: any) => {
// do something with the input
};
}
@Filter({
filterName: 'filter2',
module: moduleName
})
public filter2() {
return (input:any) => {
console.log('vnKey', input);
};
}
}
export let moduleName = 'run.module';
export class YourRunConfig {
@Run({
module: moduleName
})
public run1() {
}
}
export let moduleName = 'config.module';
export class YourRunConfig {
@Config({
module: moduleName
})
public config1() {
}
}
you can just take the exported module names into your angular.module and build it with webpack