6

I belong to the php, Laravel and new starter on angular and typescript.

I want to know whether there are some Traits and Helpers like the php.

I have seen that there is the declined proposal:

https://github.com/Microsoft/TypeScript/issues/311

Also someone have tried to implement the Helpers as Service: https://stackoverflow.com/a/35666878/3887342

What is the best way to write Helpers and Traits if available?

Community
  • 1
  • 1
PaladiN
  • 4,625
  • 8
  • 41
  • 66
  • 1
    You might want to look into [mixins](https://javascriptweblog.wordpress.com/2011/05/31/a-fresh-look-at-javascript-mixins/) instead. There are more [specific](http://shout.setfive.com/2015/05/18/javascript-mixins-in-angularjs/) angular examples flying around. – R. Chappell Nov 29 '16 at 12:35
  • 1
    @R.Chappell I understood the mixins but what if the functions in the main mixin class changes? For the instance in this example: https://www.typescriptlang.org/docs/handbook/mixins.html if the functions get added or removed in the specific mixin class, we do need to remove or add on the implemented places. Isn't that more task to do?? – PaladiN Nov 30 '16 at 08:58

0 Answers0