NPM
If external library like jQuery is installed using NPM
npm install --save jquery
Add script path into your angular-cli.json
"scripts": [
"../node_modules/jquery/dist/jquery.js"
]
Assets Folder
You can also save the library file in your assets/js directory and in...
To use jquery in your Angular 2.x components, declare a global variable on the top
If using $ for jQuery
declare var $: any;
If using jQuery for jQuery
declare var jQuery: any
This will allow using $ or jQuery into your Angular 2.x component.
AWS-SDK for javascript
Lambda contains aws-sdk (https://aws.amazon.com/sdk-for-node-js/) in its global so no need to upload this node-module into the zip.
const AWS = require('aws-sdk');
Sample function
module.exports.myFunction = (event, context, callback) => {
const response = {
...
The following is an example of using an user-defined function to be called multiple(∞) times in a script with ease.
import turtle, time, random #tell python we need 3 different modules
turtle.speed(0) #set draw speed to the fastest
turtle.colormode(255) #special colormode
turtle.pensize(4) #siz...
Install cordova using the following command npm install -g cordova.
Use cordova -version to check the cordova version.
Set path variables ANDROID_HOME and JAVA_HOME.
Example:
export ANDROID_HOME = /home/geethu/android-sdk-linux
export PATH = $PATH:$ANDROID_HOME/tools:$ANDROID_H...
The Stock Items screen (IN.20.25.00) is one of the most often used data entry forms of Acumatica ERP to export data. Inventory ID is the only primary key on the Stock Items screen:
To export records from a data entry form, your SOAP request must always begin with the ServiceCommands.Every[Key] co...
Redis provides two functions for removing keys from the database: del and unlink.
The del function removes one or more keys from the database. The del command causes Redis to immediately reclaim the memory for the deleted key on the current thread of execution. The execution time for del is propo...
To create a new project ng new [project-name] which initializes git.Install packages for tooling via npm. It creates the project successfully.
cd [project-name] and execute either npm start or ng serve
It'll run the server in the given default port.
Application will refresh according to the chan...
The Sales Orders screen (SO.30.10.00) is a perfect example of a data entry form with a composite primary key. The primary key on the Sales Orders screen is composed by the Order Type and the Order Number:
The recommended 2-step strategy to export data from the Sales Orders screen or any other dat...
Given the following custom Boolean type we want to wrap:
typedef char MYBOOL;
#define TRUE 1
#define FALSE 0
A simple approach might be to write the following typemaps in our SWIG interface:
%typemap(in) MYBOOL %{
// $input is what we got passed from Python for this function argument
$1...
Go to terminal,
cd projectFolder
git remote -v (it will show previous git url)
git remote set-url origin https://[email protected]/username/newName.git
git remote -v (double check, it will show new git url)
git push (do whatever you want.)
Currying is the process of transforming a function that takes multiple arguments into a sequence of functions that each has only a single parameter. Currying is related to, but not the same as, partial application.
Let's consider the following function in JavaScript:
var add = (x, y) => x + y
...
bindings: {
mandatory: '='
optional: '=?',
foo: '=?bar'
}
Optional attributes should be marked with question mark: =? or =?bar. It is protection for ($compile:nonassign) exception.
We injecting the module in the application
var Registration=angular.module("myApp",["ngRoute"]);
now we use $routeProvider from "ngRoute"
Registration.config(function($routeProvider) {
});
finally we integrating the route, we define "/ad...
In traditional object-oriented languages, x = x + 1 is a simple and legal expression. But in Functional Programming, it's illegal.
Variables don't exist in Functional Programming. Stored values are still called variables only because of history. In fact, they are constants. Once x takes a value, it...
A single line comment starts with two hyphens (--) and extends up to the end of the line. Example :
-- This process models the state register
process(clock, aresetn)
begin
if aresetn = '0' then -- Active low, asynchronous reset
state <= IDLE;
elsif rising_edge(clock) then --...