How to add container to nav_menu sub menu in WordPress?

Posted by Jessica Taylor | Updated on | WordPress


If you want to add container to nav_menu sub menu in WordPress? Use following code in your theme’s functions.php file OR in site specific plugin. Usage in your theme:

How to pass the arguments to a admin menu page callback?

Posted by Jessica Taylor | Updated on | WordPress


If you want to pass the arguments to a admin menu page callback in WordPress? you can use this to look up what file you need to load (you can also store additional data in …

Program to check prime number using c programming

Posted by Jessica Taylor | Updated on | C


In this program, I have shared how to check prime number using c programming? I assume you should have the knowledge of the following c programming topics like C if…else Statement, C for Loop, and …

How to disable text selection highlighting using CSS?

Posted by Jessica Taylor | Updated on | CSS


In this example, I have shared how to disable text selection highlighting using CSS? According to Can I use, the user-select is currently supported in all browsers except Internet Explorer 9 and earlier versions (but …

How to get list of methods in a Python class?

Posted by Jessica Taylor | Updated on | Python


If you want to get list of methods in a Python class? An example (listing the methods of the optparse.OptionParser class): Notice that getmembers returns a list of 2-tuples. The first item is the name …

How to declare Return Types for Functions in TypeScript

Posted by Jessica Taylor | Updated on | Typescript


If you want to declare Return Types for Functions in TypeScript? Below is a fully working example – you’ll see that var result is implicitly a string because the return type is specified on the …

How to load external scripts dynamically in Angular?

Posted by Jessica Taylor | Updated on | AngularJS


If you want to load external scripts dynamically in Angular? If you’re using system.js, you can use System.import() at runtime: If you’re using webpack, you can take full advantage of its robust code splitting support …

How to use Object.values with typescript?

Posted by Jessica Taylor | Updated on | Typescript


Want to use Object.values with typescript? You can use Object.keys instead of Object.values in typescript.

How to use a typescript enum value in an Angular2 ngSwitch statement?

Posted by Jessica Taylor | Updated on | AngularJS


If you want to use a typescript enum value in an Angular2 ngSwitch statement? You can create a reference to the enum in your component class (I just changed the initial character to be lower-case) …

How to initialize a TypeScript object with a JSON object?

Posted by Jessica Taylor | Updated on | Typescript


Want to initialize a TypeScript object with a JSON object? The problem with this approach is mostly that the name of any member must match its class. Which automatically limits you to one member of …

How to get query params from url in Angular 2?

Posted by Jessica Taylor | Updated on | AngularJS


In this example, I have shared how to get query params from url in Angular 2? You can do by injecting an instance of ActivatedRoute one can subscribe to a variety of observables, including a …

How to convert a string to enum in TypeScript?

Posted by Jessica Taylor | Updated on | Typescript


Want to convert a string to enum in TypeScript? Enums in TypeScript 0.9 are string+number based. You should not need type assertion for simple conversions.

How to get names of enum entries in Typescript?

Posted by Jessica Taylor | Updated on | Typescript


Want to get names of enum entries in Typescript? The code you posted will work; it will print out all the members of the enum, including the values of the enum members. For example, the …

Constructor overload in TypeScript

Posted by Jessica Taylor | Updated on | Typescript


In this example, I have shared constructor overload in TypeScript Regarding constructor overloads one good alternative would be to implement the additional overloads as static factory methods. I think its more readable and simple than …

How to define a private property when implementing an interface in Typescript?

Posted by Jessica Taylor | Updated on | Typescript


If you want to define a private property when implementing an interface in Typescript? Interfaces define “public” contracts and as such it doesn’t make sense to have protected or private access modifier on interfaces, which …