You need to tell angular that you updated the var:
function TestCtrl($scope) { $scope.loading = true; setTimeout(function () { $scope.$apply(function(){ $scope.loading = false; }); }, 1000); }
or just
function TestCtrl($scope, $timeout) { $scope.loading = true; $timeout(function () { $scope.loading = false; }, 1000); }
Related Posts:
- How to get all place details from a Place Details Request using Google Places API Web Service?
- SyntaxError: Unexpected token o in JSON at position 1
- SyntaxError: Unexpected token o in JSON at position 1
- SyntaxError: Unexpected token o in JSON at position 1
- SyntaxError: Unexpected token o in JSON at position 1
- AngularJS- Login and Authentication in each route and controller
- TypeError: Cannot read property ‘then’ of undefined
- How to Create simple drag and Drop in angularjs
- Working with $scope.$emit and $scope.$on
- In angularjs we are having ng-disabled directive, why ng-enabled directive is not provided by the framework as we are having ng-show and ng-hide
- Regular expression : match either of two conditions?
- SyntaxError: Unexpected token o in JSON at position 1
- AngularJS : Factory and Service?
- Give a value to an ng-model=”searchText” input based on list item clicked in Angular JS
- TypeError: Cannot read property ‘get’ of undefined on AngularJS
- Blocked script execution in because the document’s frame is sandboxed – Angular application
- Angular JS Uncaught Error: [$injector:modulerr]
- Use of $parse in angular js
- How to set the id attribute of a HTML element dynamically with angularjs (1.x)?
- Using $setValidity inside a Controller
- How can I group data with an Angular filter?
- Error: ENOENT: no such file or directory, stat ‘/public/main.html’ at Error (native)
- Disable Chrome strict MIME type checking
- Angularjs: Error: [ng:areq] Argument ‘HomeController’ is not a function, got undefined
- Error: [ng:areq] from angular controller
- SyntaxError: expected expression, got ‘<'
- Understanding the ngRepeat ‘track by’ expression
- How to pass parameters using ui-sref in ui-router to controller
- What does ngf-select do and why is it needed for form validation?
- why angularjs ng-repeat not working
- How to connect signalR from angularJs
- Array Mapping in AngularJs
- AngularJS errors: Blocked loading resource from url not allowed by $sceDelegate policy
- How do you serve a file for download with AngularJS or Javascript?
- Failed to execute ‘postMessage’ on ‘DOMWindow’: https://www.youtube.com !== http://localhost:9000
- How to redirect to another page using AngularJS?
- How to enable CORS in AngularJs
- How do I bind to list of checkbox values with AngularJS?
- parsing JSONP $http.jsonp() response in angular.js
- AngularJS POST Fails: Response for preflight has invalid HTTP status code 404
- What is the cause for “angular is not defined”
- $http.get(…).success is not a function
- Unexpected token < in first line of HTML
- ngular is automatically adding ‘ng-invalid’ class on ‘required’ fields
- Check if a string has a certain piece of text [duplicate]
- How to convert a string to an integer in JavaScript?
- How to create an associative array in JavaScript literal notation
- Include another HTML file in a HTML file
- Cannot open local file – Chrome: Not allowed to load local resource
- What’s the best way to convert a number to a string in JavaScript?
- React Native: this.setState is not a function
- How to perform string interpolation in TypeScript?
- forEach is not a function error with JavaScript array
- Short circuit Array.forEach like calling break
- How do I format date in jQuery datetimepicker?
- Express Render not working return error: No default engine was specified and no extension was provided
- Remove Object from Array using JavaScript
- Angular4 – No value accessor for form control
- What is the difference between ( for… in ) and ( for… of ) statements?
- Cannot read property ‘bind’ of undefined. React.js
- Why is my asynchronous function returning Promise {
} instead of a value? - NodeJs : TypeError: require(…) is not a function
- Sort array by firstname (alphabetically) in Javascript
- Sorting arrays in javascript by object key value
- jQuery: Check if div with certain class name exists
- Objects are not valid as a React child. If you meant to render a collection of children, use an array instead
- Set value of hidden input with jquery
- How does AJAX work?
- How to remove all duplicates from an array of objects?
- Finding the average of an array using JS
- Creating a div element in jQuery
- Does ECMAScript 6 have a convention for abstract classes?
- Why is jquery show() not working in example
- console.log showing contents of array object
- How can I use jQuery to run MySQL queries?
- Using setTimeout on promise chain
- Regular Expression to reformat a US phone number in Javascript
- What does `node –harmony` do?
- Preventing YouTube embeds loading multiple instances of player JS?
- WordPress Errors? Update Failed! data.min.js
- How to handle malformed response from WP REST API?
- Use useSelect/useDispatch instead of withSelect/withDispatch
- Trouble adding JavaScript in visual editor (Sharpspring embed code)
- How to set translations in javascripts for my plugin?
- How to make wordpress URLS google friendly for ajax driven sites?
- Get a default value of the Customizer setting using wp.customize API (JS)
- Google PageSpeed Enable Compression isn’t working?
- How can I add Javascript in the header of all post pages and only post pages
- wp_enqueue_script not loading my custom js file
- Add captcha validation to my custom form for Frontend posting
- AddThis Sharing Bar Not Displaying on Custom Page Template – JS conflict?
- Bootstrap bundle present in page source but not working
- Add JavaScript-Library “Fitty” to WordPress
- Access checks with custom REST endpoints and backbone
- How to pass data to javascript in custom widget class
- jQuery + more won’t load in header
- How to add additional JavaScript code [duplicate]
- JavaScript errors
- How to load JavaScript modules with script_loader_tag hook?
- How to securely set dynamic HTML content with JavaScript?