AngularJS: How to nest applications within an angular app

You can’t bootstrap a module inside another bootstrapped module. Bootstrapping compiles the view and binds a rootScope to it, traversing it’s way through the DOM and setting up scope bindings and executing directive linking functions all the way through. If you do that twice, you’re going to run into problems. You’re probably going to have … Read more

AngularJS $watch vs $watchCollection: which is better for performance?

$watch() will be triggered by: $scope.myArray = []; $scope.myArray = null; $scope.myArray = someOtherArray; $watchCollection() will be triggered by everything above AND: $scope.myArray.push({}); // add element $scope.myArray.splice(0, 1); // remove element $scope.myArray[0] = {}; // assign index to different value $watch(…, true) will be triggered by EVERYTHING above AND: $scope.myArray[0].someProperty = “someValue”; JUST ONE MORE … Read more

How does AngularJS’s $watch function work?

All watches are evaluated (sometimes multiple times) every digest loop. The digest loop is entered as a result of some event, or calling $apply(). Watches are not called periodically based on a timer. See https://docs.angularjs.org/guide/scope#integration-with-the-browser-event-loop The browser’s event-loop waits for an event to arrive. The event’s callback gets executed… Once the callback executes, the browser … Read more

Alternative to $scope in Angular 2.0

Angular 2.0 is using this instead of $scope. One of the major changes coming in 2.0 is the death of the controller, and a new emphasis on components. Big advantage of moving towards component-based apps is that it’s easier to define their interfaces; plus, HTML elements already have an easily mappable interface in events, attributes, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)