Stack Overflow is a community of 4.7 million programmers, just like you, helping each other.

Join them; it only takes a minute:

Sign up
Join the Stack Overflow community to:
  1. Ask programming questions
  2. Answer and help your peers
  3. Get recognized for your expertise
<div ng-app>

<form ng-submit="addTodo()">
  <input type="text" ng-model="todoText"  size="30"
         placeholder="add new todo here" id="inputtext">
  <input class="btn-primary" type="submit" value="add">

</form>

<script type="text/javascript" src="js/process1/Process1Controller.js"></script>

I want to load specified js file after html load since id of input textbox is used in js .

i have seen different thread and done many experiments for this like

$scope.$on('$viewContentLoaded', function(){

}) but issue not resolved

share|improve this question
    
What exactly is the issue? Angular-Controller do start after the DOM is ready. So it is irrelevant when the script is loaded. – phylax Apr 30 '14 at 15:42

This is a hack, and not likely the proper way to do things, but try using ng-if to dynamically populate the items on the page:

//HTML

<script ng-init='myVariable = true' ng-if='myVariable' type="text/javascript" src="myJsToLoad.js"></script>

again, this is not the proper way to do things in angular, but it should work

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.