In what JS engines, specifically, are toLowerCase & toUpperCase locale-sensitive?

Note: Please, note that I couldn’t test it! As per ECMAScript specification: String.prototype.toLowerCase ( ) […] For the purposes of this operation, the 16-bit code units of the Strings are treated as code points in the Unicode Basic Multilingual Plane. Surrogate code points are directly transferred from S to L without any mapping. The result … Read more

How to destroy an angularjs app?

Using AngularJS 1.4.0, $rootScope.$destroy() is working again (as it was broken in 1.2). Using this permits to switch between several angularJS apps: var appManager = new function () { this.currentAppName; this.currentApp; this.startApp = function (appContainerId, appName) { if (this.currentApp) { this.destroyApp(this.currentApp, this.currentAppName); } var appContainer = document.getElementById(appContainerId); if (appContainer) { this.currentAppName = appName; this.currentApp = … Read more

Getting form controls from FormController

For a direct solution to the question, modify @lombardo’s answer like so; var dirtyFormControls = []; var myForm = $scope.myForm; angular.forEach(myForm, function(value, key) { if (typeof value === ‘object’ && value.hasOwnProperty(‘$modelValue’) && value.$dirty) dirtyFormControls.push(value) }); The array ‘dirtyFormControls’ will then contain the form controls that are dirty. You can also use this trick to show … Read more

W3C validation with AngularJS directives

Strict w3c validation allows any data-* attributes, and any class. Directives can be applied to DOM elements with any of: <tag directive-name> <tag data-directive-name> (*) <tag x-directive-name> <tag directive_name> <tag x_directive_name> <tag data_directive_name> At least the data- one is fully W3C compliant (provided you declare HTML5 doctype). So the following code validates (the attribute name, … Read more

Angularjs access local json files [duplicate]

You can refer to json file calling them with a GET method, like so: $http.get(‘phones/phones.json’).success((data) => { $scope.phones = data; }); Check the official AngularJS tutorial to see what you are doing wrong. Update: For angular 1.6+ success method is not valid anymore instead use then: $http.get(‘phones/phones.json’).then((data) => { $scope.phones = data; }); Refer to … Read more

Accessing Angular inside Protractor Test

There is a function called evaluate(). Find an element in the dom and then run the expression. For example. If you want to count the number of todos in the http://angularjs.org/ website (under Add Some Control), do this: Open the element explorer in protractor ./node_modules/protractor/bin/elementexplorer.js browser.get(‘http://angularjs.org/’) element(by.model(‘todoText’)).evaluate(‘todos.length’). then(function(count) { console.log(count) }); It should give you … Read more

How to reduce/remove memory leaks in Angular application

Remove bindings to avoid memory leaks, Use Scopes $destroy() Method. Note: The most likely culprit of memory leak in Angular is JQuery used in your directives. If you attach an event-listener in your directive using a JQuery plugin, the latter would keep a reference to your DOM even after Angular deletes its own reference to … Read more

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