-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

5
  • 1
    There's no way. Even minified its readabble. Commented Jan 22, 2014 at 10:48
  • Anything on the client side is always visible. Commented Jan 22, 2014 at 10:50
  • You could try this javascriptobfuscator.com Commented Jan 22, 2014 at 10:56
  • 1
    When you say you cant see JS on other websites are you sure that the JS is not linked from a external source Commented Jan 22, 2014 at 11:02
  • That is a good question Qwertie. I'll look for it. Commented Jan 22, 2014 at 11:10

4 Answers 4

2

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

Sign up to request clarification or add additional context in comments.

Comments

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.

1 Comment

Also it would slow down page loading
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

Comments

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++.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.