Sort and Filter a Table Using Angular

Sort and Filter a Table Using #Angular  #angularjs

  • Here’s the line that we will add to our ng-repeat code from our file:

    That’s all we need to change the sort order of our ng-repeat.

  • Here’s the updated section inside of our :

    Now as you click the links across your table headers, you’ll see your table sorted since we are setting the

    Next up, we’ll be adding a way to change the sort order so users can sort by ascending or descending.

  • The way we will give users the option to reverse the sort is to add in the of our table headers.
  • Now if you click your header links, you’ll see the sort order changing.
  • With a few Angular directives, we are now able to show proper feedback for sorting and for sort order.

When building Angular applications, one of the cornerstones we will…
Continue reading “Sort and Filter a Table Using Angular”

AngularJS 2.0 From The Beginning

#AngularJS 2.0 From The Beginning - #ngForm - Day 16 by @debasiskolsaha cc @CsharpCorner

  • So far, we have discussed about data binding, input properties, output properties, pipes, viewchild, Directives, Services including routes and template based form binding, using ngForms in Angular 2.0.
  • Now, in this article, I will discuss how to create model based form, using Angular form module in Angular 2.0.
  • In my previous article, I already discussed about the template driven form binding in Angular 2.0.
  • Now, in this article, we will discuss about the Model Driven or Reactive Form binding in the Angular 2.0.
  • To begin, we must first ensure that we are working with the right Directives and the right classes in order to take advantage of procedural forms.

In this article, we will discuss model based form binding in Angular 2.0.
Continue reading “AngularJS 2.0 From The Beginning”

Learning Angular 2 for newbie – Part 2

  • Component: It will have binding logic in order to bind UI(html) with the Model(Business)

    Module: It is nothing but logical grouping of component.

  • Now under the Component folder created create an new”CustomerComponent.ts” we need to import two things the Angular 2 core and our Customer model.
  • Following are the lines of code

    The first line imports the “Customer” class from the Model folder into our “CustomerComponent.ts”.

  • Followed by that create a Module folder as said earlier Module is logical grouping of all Components.In Module folder create “TypeScript” file with name “MainModuleLibrary.ts” which will have all necessary components required loading in it.
  • Within this “Startup.ts” file we will have name of the module which will be loading first is the snapshot of the Startup.ts file created within Startup folder as shown in the image down below.

Learning Angular 2 for newbie – Part 2 In this article before we start with the Angular2 project first we will understand Angular2 component and module architecture thereafter we create simple app
Continue reading “Learning Angular 2 for newbie – Part 2”

java

How to avoid NullPointerException?  #angularjs #reactjs

  • So lets look at what is says: The first line of the stack trace tells you a number of things: It tells you the name of the Java thread in which the exception was thrown.
  • But you can be sure that the second line (the first “at” line) will tell you where the NPE was thrown1.
  • The first “at” line would say that the exception was thrown in some line in the class, and line 4 of would be the second “at” line.
  • length(); } public static void main(String[] args) { int length = test(foo, 1); } } $ javac Test.java $ java Test Exception in thread “main” java.lang.NullPointerException at Test.test(Test.java:6) at Test.main(Test.java:10) $ So now we have 2 “at” lines.
  • The first one is for this line: and the second one is for this line: So looking at the first line, how could that throw an NPE?

What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Continue reading “java”

Unit Testing with AngularJS

  • Unit testing an Angular app definitely doesn’t escape this paradigm.
  • When I first started with TDD and Angular, I felt that I was spending twice (maybe more) as much time on figuring out just how to test and maybe even more on setting my tests up correctly.
  • However, as I have progressed in learning more about Angular and unit testing, I am spending much less time on setting up tests and much more time on making tests go from red to green — which is a good feeling.
  • I have come across different methods of setting up my unit test to mock services and promises.
  • Why set up a whole mock promise when we can just use the tool that Angular gives us.

This post covers how to set up unit tests that mock services and promises in AngularJS.
Continue reading “Unit Testing with AngularJS”

Amazon: AngularJS: AngularJS. “A Code Like a Pro Guide” For AngularJS Beginners (Programming for Beginners, AngularJS for Beginners, AngularJS Programming Language, … for Dummies, Learn AngularJS Fast Book 1) eBook: Jonathan Bates, AngularJS: Kindle Store

Buy AngularJS: AngularJS. “A Code Like a Pro Guide” For AngularJS Beginners (Programming for Beginners, AngularJS for Beginners, AngularJS Programming Language, … for Dummies, Learn AngularJS Fast Book 1): Read 3 Books Reviews – Amazon.com
Continue reading “Amazon: AngularJS: AngularJS. “A Code Like a Pro Guide” For AngularJS Beginners (Programming for Beginners, AngularJS for Beginners, AngularJS Programming Language, … for Dummies, Learn AngularJS Fast Book 1) eBook: Jonathan Bates, AngularJS: Kindle Store”

Windows batch script: use variable in diff command not working

Windows batch script: use variable in diff command not working  #angularjs #reactjs

  • My script is only simple.
  • I’ve got the code so far to set 2 variable’s of 2 filenames that are dynamic (may be different every time the script is run).
  • Now I want to use those variables in a “diff” command.
  • It may be relevant that I’m using GNU Diffutils

    The output at the moment is:

    I need the script to be able to put the variable file name in the command, so:

I’m fairly new to batch scripting. My script is only simple.
I’ve got the code so far to set 2 variable’s of 2 filenames that are dynamic (may be different every time the script is run).
Continue reading “Windows batch script: use variable in diff command not working”