By default, Angularjs is not loading script if we put it in partial HTML. Also, it is compiling the HTML  once template is loaded. So subsequent request template will be loaded from browser cache instead of from server.

In some cases, we want to execute some codes whenever partials loaded (for eg: Tracking page count code, putting Google Analytics code or any other tracking code).

So the solution is to call Jquery before loading Angularjs. This way, Angular in-built JQlite is detached and Angular will use full fledged of external Jquery.

index.html

The following partials are used in this demo.
– home.html
– projects.html
– services.html
– downloads.html
– about.html
– contact.html

Each file contains inline script with console log and it will be printed whenever the partials are loaded.

Demo: http://www.amasik.com/demo/angularjs/exec_inline_script/
Enable developer tool and check the console log.