Skip to content

Instantly share code, notes, and snippets.

@RyanABailey
Created September 12, 2014 03:40
Show Gist options
  • Select an option

  • Save RyanABailey/1e692377e1a75d498e94 to your computer and use it in GitHub Desktop.

Select an option

Save RyanABailey/1e692377e1a75d498e94 to your computer and use it in GitHub Desktop.
angularJs run code after page load
<div id="myDiv" ng-controller="MyCtrl">
</div>
var MyCtrl = [
'$scope', '$timeout',
function ($scope, $timeout) {
$timeout(function () {
// code here
}, 0);
}
];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment