-5

I'm quite new to Angular. I've done a lot of things with it. Built an internal website in my organization.

When I inspect regular web pages with chrome dev tools, I generally can't see any important javascript source files. But when I inspect my own angularjs web site, all of my controllers, directives and factories are there, exposed to everyone.

How can I hide them from users? Do I just have to minify them?

Thanks

Xelom
  • 1,615
  • 1
  • 13
  • 23

4 Answers4

2

There is no way you can hide your script from client.

Bhushan
  • 6,151
  • 13
  • 58
  • 91
1

You could obfuscate it a lot, making each function dependant on another, building a massive "web" of functions that all depend on each other, but that would also make the code really REALLY messy for yourself. The best thing you could do is just put a license in your script, using /* */ and that will atleast prevent most buisnesses from stealing the code.

Joeytje50
  • 18,636
  • 15
  • 63
  • 95
0

Javascript files are downloaded to the client so there is not much you can do.

You can try to obfuscate javascript but it's mostly a waste of time IMO

Community
  • 1
  • 1
Neil Thompson
  • 6,356
  • 2
  • 30
  • 53
0

There is no way to do this. At best you can compress your JavaScript to make is less readable but at the end of the day if someone want's access to your code they can get it. That said, this is true for most programming language now a days. It's fairly easy to get the code for apps written in Java, C#, VB, and Managed C++.

rbrundritt
  • 16,570
  • 2
  • 21
  • 46