I have a simple chat server/client app, written in PHP (server side, 100% my own code) and AngularJS. The process for Angular development typically brings in many libraries with various licenses. Of the hundreds of files involved with the source of the project, I've created 5 of them from scratch, with no edits or changes made to any of the other code.

What I would like to do is license under the GPLv2 the actual TypeScript code that I have written, on a file-by-file basis for my 2 PHP files and 5 TypeScript files. All 7 of these files are 100% created/written by me.

Obviously, since the PHP code is all mine I can license it how I want, and it can be used stand-alone if the client side is re-implemented in any other language.

But what about my TypeScript? Can I license code that I wrote in any way I want - specifically GPLv2 - on a file by file basis, regardless of what other code it operates with/depends on and the license that other code uses?

My thinking on this is that some other user can decide to accept the terms of whatever license the libraries are under, and can use the code that I wrote under the provisions of the GPLv2. In theory, a user could use only the code I wrote to do some other project using some other framework as well.

1 Answer 1


[Obligatory disclaimer - I am not a lawyer]

In a nutshell, yes. As long as your code stands alone and there clear borders between it and Angular itself, you can license it however you please. It's up to whoever wants to use your code to make sure he does so in a way that complies with the license (and the license of the other components he or she is using).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.