AngularJS: Filter ng-options not having specific values

AngularJS NOT Filter <select ng-model=”test” ng-options=”c as c.label group by c.type for c in columns | filter:{ type : ‘!field’ } | filter:{ type : ‘!map’ }”> </select> Fiddle From the docs: “…The predicate can be negated by prefixing the string with !.” “A pattern object can be used to filter specific properties on objects … Read more

Is it possible to apply multiple AngularJS controllers on the same element

No, you cannot apply two controllers to the same element, but you can apply multiple directives. And directives can have controllers. app.directive(‘myDirective1’, function() { return { controller: function(scope) { //directive controller } }; }); app.directive(‘myDirective2’, function() { return { controller: function(scope) { //directive controller } }; }); and in the HTML: <div myDirective1 myDirective2></div> And … Read more

How to run a single specific test case when using protractor

Jasmine added fit and fdescribe in 2.1 for running single tests or describe blocks. http://pivotallabs.com/new-key-features-jasmine-2-1/ This feature almost made it in the 2.0 release. Now enough of this functionality is present to support fit and fdescribe for focused spec and suite running. from 2.1 git lib/jasmine-core/jasmine.js var jasmineInterface = { describe: function(description, specDefinitions) { return … Read more

Question Mark in Directive Require

It’s exactly what you guessed: ? makes a directive optional. Basically, these are at your disposal when defining directive requirements: someDirective : Require someDirective on same element and pass it to linking function ?someDirective : Pass someDirective controller if available on same element to linking function. If not, pass null. ^someDirective : Require someDirective on … Read more

orderBy not working as expected: Angularjs

Have a look at below html <!DOCTYPE html> <html ng-app=”app”> <head> <title></title> <script src=”https://ajax.googleapis.com/ajax/libs/angularjs/1.0.5/angular.min.js”></script> </head> <body> <div ng-controller=”item”> <ul> <li ng-repeat=”item in items|orderBy:’name'”> {{item.name}} </li> </ul> </div> <script> var AppModule = angular.module(‘app’, []); function item($scope) { $scope.items = [{ name: ‘tur’ }, { name: ‘abc’ }, { name: ‘xyx’ }]; } </script> </body> </html>

Scroll to in angularjs

Angulars routing seems to pick up the change, which in my case is bad because the scrollTo reroutes me to back to the main admin page. Scrolling and then resetting the $location.hash() so angular does not perceive a change in url seems to work. $scope.scrollTo = function (id) { var old = $location.hash(); $location.hash(id); $anchorScroll(); … Read more

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