Tutorial by Examples: 2

The following example shows how to properly construct both GET and POST requests against Web API 2 (CORS must be configured server-side, if sent from another domain): <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.js"></script> CORS with Wi...
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js"></script> CORS with Windows Authentication test (Angular) <script type="text/javascript"> var app = angular.module('myApp', []); app.c...
FormComponent.ts import {Component} from "@angular/core"; import {FormBuilder} from "@angular/forms"; @Component({ selector: 'app-form', templateUrl: './form.component.html', styleUrls: ['./form.component.scss'], providers : [FormBuilder] }) export class FormComp...
Implemented in a router: export const MainRoutes: Route[] = [{ path: '', children: [ { path: 'main', component: MainComponent , canActivate : [CanActivateRoute] }] }]; The canActivateRoute file: @Injectable() export class CanActivateRoute implements CanActi...
service I created post service with postRequest method. import {Injectable} from '@angular/core'; import {Http, Headers, Response} from "@angular/http"; import {PostModel} from "./PostModel"; import 'rxjs/add/operator/map'; import {Observable} from "rxjs"; ...
run the follows commands at cmd npm install -g protractor webdriver-manager update webdriver-manager start **create protractor.conf.js file in the main app root. very important to decleare useAllAngular2AppRoots: true const config = { baseUrl: 'http://localhost:3000/', s...
Incorrect code Sub DoSomething() On Error GoTo CleanFail DoSomethingElse CleanFail: Debug.Print Err.Number Resume Next End Sub Why doesn't this work? If the DoSomethingElse procedure raises an error, execution jumps to the CleanFail line label, prints the error number, a...
Open Function.cs and replace the class code with the following: public class Function { /// <summary> /// A simple function that takes a birth date and returns Age in years /// </summary> /// <param name="input"></param> /// <returns>Age is years&...
Requirements: NodeJS : Download page npm or yarn Run the following commands with cmd from new directory folder: npm install -g @angular/cli or yarn global add @angular/cli ng new PROJECT_NAME cd PROJECT_NAME ng serve Open your browser at localhost:4200
Once the sports2000 database has been installed it's time to run it as a standalone server (and not connect to it as a file). Start proenv (proenv in the startmeny on Windows or /usr/install-directory/bin/proenv on Linux/Unix). This example is from Windows. Linux is the same but you need to change...
After installing Visual studio code configure .net core and C#. Configure C# based on market-place. Reference Url: C# market place .net core Launch Visual studio code. Press [ctrl + P] paste "ext install csharp" this and hit. Once done above steps , C# extension available i...
Add these two files in this order above the files for the main window. MyControl.xaml <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc=&quo...
import numpy as np import matplotlib.pyplot as plt # create some data x = np.arange(-2, 20, 0.5) # values of x y1 = map(lambda x: -4.0/3.0*x + 16, x) # values of y1(x) y2 = map(lambda x: 0.2*x**2 -5*x + 32, x) # svalues of y2(x) fig = plt.figure() ax1 = fig.add_subplo...
require(["N/search", "N/currentRecord"], function (s, cr) { /** * An example of N/search#lookupFields to retrieve a single field from a related record */ (function () { var record = cr.get(); // Get the Sales Rep record ID ...
require(["N/search", "N/currentRecord"], function (s, cr) { /** * An example of N/search#lookupFields to retrieve multiple fields from a related record */ (function () { var record = cr.get(); // Get the Sales Rep record ID v...
require(["N/search", "N/currentRecord"], function (s, cr) { /** * An example of N/search#lookupFields to retrieve joined fields from a related record */ (function () { var record = cr.get(); // Get the Sales Rep record ID var...
/** * A SuiteScript 2.0 example of using N/record#submitFields to update a single field on a related record */ require(["N/record", "N/currentRecord"], function (r, cr) { // From a Sales Order, get the Customer ID var customerId = cr.get().getValue({"field...
/** * A SuiteScript 2.0 example of using N/record#submitFields to update multiple fields on a related record */ require(["N/record", "N/currentRecord"], function (r, cr) { // From a Sales Order, get the Customer ID var customerId = cr.get().getValue({"fiel...
Given a normalized phone number like +178612345678 we will get a formatted number with the provided pattern. private String getFormattedNumber(String phoneNumber) { PhoneNumberUtil phoneNumberUtil = PhoneNumberUtil.getInstance(); Phonemetadata.NumberFormat numberFormat = new P...
// How many lines in a sublist in SuiteScript 2.0... require(["N/record"], function (r) { var rec = r.load({ "type": r.Type.SALES_ORDER, "id": 123 }); // How many lines are on the Items sublist? var itemCount = rec.getLineCount...

Page 16 of 21