Authentication: JWT usage vs session

JWT doesn’t have a benefit over using “sessions” per se. JWTs provide a means of maintaining session state on the client instead of doing it on the server. What people often mean when asking this is “What are the benefits of using JWTs over using Server-side sessions“. With server-side sessions, you will either have to store … Read more

How to apply filters to *ngFor?

Basically, you write a pipe which you can then use in the *ngFor directive. In your component: In your template, you can pass string, number or object to your pipe to use to filter on: In your pipe: Remember to register your pipe in app.module.ts; you no longer need to register the pipes in your @Component Here’s a Plunker which … Read more

How to create a file in Ruby

Use: where your options are: r – Read only. The file must exist. w – Create an empty file for writing. a – Append to a file.The file is created if it does not exist. r+ – Open a file for update both reading and writing. The file must exist. w+ – Create an empty file for both reading and … Read more

What are App Domains in Facebook Apps?

the app domain is your domain name. Before you enter your domain, first click on Add Platform, select website, enter your site URL and mobile site url. Save the settings. Thereafter, you can enter the domain name in the App domains field. See more at my blog: http://www.ogbongeblog.com/2014/03/unable-to-add-app-domains-to-new.html

What is a blob URL and why it is used?

Blob URLs (ref W3C, official name) or Object-URLs (ref. MDN and method name) are used with a Blob or a File object. src=”blob:https://crap.crap” I opened the blob url that was in src of video it gave a error and i can’t open but was working with the src tag how it is possible? Blob URLs can only be generated internally by the … Read more

How to fix “TypeError: Right-hand side of ‘instanceof’ is not callable” when I use another module class?

The problem is that you have a circular dependency. The other file requires index, index requires Transaction, and Transaction requires index. So, when transaction runs, it tries to require index, whose module is already in the process of being built. index hasn’t exported anything yet, so requiring it at that time results in an empty object. Because both must call each other, one way to solve it would be … Read more

What does ngInject do in the following piece of code?

‘ngInject’; does nothing by itself, it’s just a string literal. A tool called ng-annotate uses it as a flag : if a function starts with ‘ngInject’;, it will be processed by ng-annotate. Basically, ng-annotate will transform to in order to make the code minification-safe. If you’re not using ng-annotate, you can safely ignore or remove the expression. Be … Read more