typescript - Solace nodejs api integration with Webpack

I have an angular2 typescript webapp which is build with webpack. I am trying to integrate solclientjs into it, but I get the exception belowsolclientjs-exports.js:34 Uncaught Error: Cannot find module "."at webpackMissingModule (solclientjs-exports.js:34)at load (solclientjs-exports.js:34)at loadProduction (solclientjs-exports.js:44)at new loader (solclientjs-exports.js:47)at Object. (solclientjs-exports.js:72)at webpack_require (bootstrap 79a17da…:52)at Object. (home.component.ts:8)at webpack_require (bootstrap 79a17da…:52)at Object. (app.ts:...Read more

typescript - How can I use ag-grid with Observable in angular2?

I have done lots of research on Internet but still cannot glue these together. I have an angular2 application, with Observable data source from HTTP, and would like to use ag-grid. The problem is I only got a loading screen instead of the data. I have investigated with Fiddler, the data is loaded successfully and correctly in JSON. Here is my code:order.service.tsimport { Injectable } from '@angular/core';import { Headers, Http, Response } from '@angular/http';import { Observable } from 'rxjs/Observable';import { Order } from './order';@I...Read more

typescript - EXCEPTION: No Directive annotation found on AgGridNg2

Why this example on TypeSctipt with ag-grid isn't work?There is error in console: EXCEPTION: No Directive annotation found on AgGridNg2Code of cars.ts with poblem line:import {Component, View} from 'angular2/angular2'import {CarsService} from './cars_service'@Component({ selector: 'cars', bindings: [CarsService]})@View({ template: ` <ag-grid-ng2 id="cars" class="ag-fresh" [column-defs]="columnDefs" [row-data]="rowData"> </ag-grid-ng2> `, //////////////////////////////////// // Problem at this line ///////////...Read more

typescript - Angular2 ag-grid datasource

I am trying to get a ag-grid datasource to work in angular2, although I got the feeling that I am nearly there I am not able to fix the following issue with my current knowledge of angular/typescript.The problem is that I have a function called returnRows, which works perfectly fine (see testdata variable). But the moment I try to call it within datasource.getRows I get the following exception: TypeError: this.returnRows is not a function in [gridOptions in PagetestComponent@2:2]. In the end I would like to replace the function with a service t...Read more

typescript - Angular2 ag-grid datasource not working

I am trying to get my ag-grid working but I get an error.Here is the code:import { Component, OnInit } from '@angular/core';import {AgGridNg2} from 'ag-grid-ng2/main';import {GridOptions} from 'ag-grid/main';import {ClientsService} from './clients.service';@Component({ moduleId: module.id, selector: 'clients', directives: [AgGridNg2], templateUrl: 'clients.component.html', providers: [ClientsService]})export class ClientsComponent implements OnInit { private gridOptions: GridOptions; private showGrid: boolean; private ro...Read more

typescript - Creating custom themes in angular material 2

I am trying to create a custom theme for my angular 2 app which is using a few components from angular material 2.I tried to google this but could'nt find much. The only documentation available is for Angular Material :- https://material.angularjs.org/latest/Theming/03_configuring_a_themeI could not locate the corresponding documentation for angular 2.So far I have a figured out that there is a file under @angular2-material/core/style named _default-theme.scss with the below contents :-@import 'theme-functions';@import 'palette';// Person creat...Read more

Not able to get the values of a sorted ag-grid column in an array using Protractor and Typescript

I have to verify the sorting function in an ag-grid.When the UI is opened, the column data will be in some order.I am sorting it in ascending order and then storing the values in a array.ag_grid_utils.clickOnHeader("Name");var testArr=[];element.all(by.css('div.ag-body-container div[col-id="Name"]'))    .map(function (Element) {        element.getText().then(function (result) {        console.log("result :: "+result);        testArr.push(result);    });})However when I print the array, the values are not sorted. They are in the same order like ...Read more

How to get the count of rows in an ag-grid using TypeScript and Protractor

I am trying to find the count of rows present in an ag-grid.The Table structure ;looks like this:<div class="ag-body-container" role="presentation" style="height: 500px; top: 0px; width: 1091px;"><div role="row" row-index="0" row-id="0" comp-id="134" class="ag-row ag-row-no-focus ag-row-even ag-row-no-animation ag-row-level-0" style="height: 50px; top: 0px;  "><div role="row" row-index="1" row-id="1" comp-id="140" class="ag-row ag-row-no-focus ag-row-odd ag-row-no-animation ag-row-level-0" style="height: 50px; top: 50px;  ">&l...Read more

azure devops - Unable to use createQuery() in typescript

I am trying to create a query using the following- https://www.visualstudio.com/en-us/docs/integrate/extensions/reference/client/api/tfs/workitemtracking/restclient/workitemtrackinghttpclient2_2#method_createQueryI am developing a vsts extension using above. This is the code-import { QueryHierarchyItem } from "TFS/WorkItemTracking/Contracts";var postedQuery = [ { "children": [], "clauses": { "field": { "referenceName": "System.WorkItemType", "name": "Work Item Type", "url...Read more

http Post request with Typescript

I am trying to find an example of HTTP post request in Typescript but can only find examples that use Angular. Could someone point me in the right direction to find this or post a quick example here of using Post with JSON data to get a response JSON....Read more

Building An Iterator With TypeScript And Rollup

I'm writing an application in TypeScript and I'm using Rollup to bundle the files together and Buble / Babel to convert the compiled Javascript into something the browser can use. However, when I run rollup -c, I get an error:semantic error TS2495 Type 'Radius' is not an array type or a string type.Not sure what to do about this, as there doesn't seem to be much information about iterators in TypeScript that I can find by the normal search-engine route. Here are my files:rollup.config.tsimport typescript from 'rollup-plugin-typescript2';import ...Read more

Why typescript enums doesn't helps to infer union type

I got the following class, which is the simple pubsub implementation:interface IAction<N, T> { name: N, data: T}export class Communicator<A extends IAction<any, any>> { public subscribe( subscriber: { name: A['name']; handler: (data: A['data']) => void; } ) {} public emit(name: A['name'], data: A['data']): void { }}and then I use it like so:enum ActionName { name1 = 'name1', name2 = 'name2'}type ExampleActions = { name: ActionName.name1, data: string } | { name: ActionName.name2, data: nu...Read more

Display Typescript enum name in Aurelia binding?

Very simple... (assume all includes and imports are properly referenced).Say you have a bindable variable of type Color on your view model (file.ts):@bindable color: Color = Color.Green;... and you are trying to display it on the view (file.html):<input type="text" value.to-view="color"></string-editor>where Color is an enum ... like this (Color.ts):export enum Color { Red, Green, Blue}This will display the numerical value of the enum on the textbox, like this:Say I want to display the name of the enum value, like this:I have the...Read more

typescript - RxJs Streams - Multiple Stream producing single master stream

I have a master list of array of objects and then two other list of selections represented also by arrays. I have these as 3 streams$.master$filter1$filter2$On the UI, master$ is is bound to a datatable using the async pipe in angular.filter1$ and filter2$ are bound to UI dropdowns as filter choices.At any point the filter1$ and filter$ can change depending on what the user selects. I feel there has to be a way to combine the 3 streams together and apply both the filters if required. How can I do this in RxJs ? Can you show me an example. Can I...Read more

How do I prevent the error "Index signature of object type implicitly has an 'any' type" when compiling typescript with noImplicitAny flag enabled?

I always compile Typescript with the flag --noImplicitAny. This makes sense as I want my type checking to be as tight as possible.My problem is that with the following code I get the error Index signature of object type implicitly has an 'any' type:interface ISomeObject { firstKey: string; secondKey: string; thirdKey: string;}let someObject: ISomeObject = { firstKey: 'firstValue', secondKey: 'secondValue', thirdKey: 'thirdValue'};let key: string = 'secondKey';let secondValue: string = someObject[key];Important to not...Read more