Tuesday, October 4, 2016

Microsoft BOT Framework

  • Microsoft Bot Framework is a comprehensive offering to build and deploy high quality bots for your users to enjoy in their favorite conversation experiences.
  • Bot Framework provides just what you need to build, connect, manage and publish intelligent bots that interact naturally wherever your users are talking – from text/sms to Skype, Slack, Facebook Messenger, Kik, Office 365 mail and other popular services.
  • Microsoft bot framework has the ability to detect the language that the user is typing and it can translate the text to other languages 

Bots , Agents of Bots, explained


  Bot



  • A bot is a software that is designed to automate tasks that would be performed by a human like booking a flight , scheduling an appointment or ordering a pizza.
  • A bot can receive a text string and perform some task and then send response as a text string
  • They are service specific. example we can have a bot for a coffee chop or a bot for yelp.

Simple component angular 2




  • Components are simply directives that are always associated with a direct template
  • Component is nothing but a type script class
  • An Angular application is a tree of Angular components

Setup angular 2 environment


  • Prerequisite: Install Node.js
  • Step 1: Create the app’s project folder and define package dependencies and special project setup
  • Step 2: Create the app’s Angular root component
  • Step 3: Create an Angular Module
  • Step 4: Add main.ts, identifying the root component to Angular
  • Step 5: Add index.html, the web page that hosts the application
  • Step 6: Build and run the app
  • Make some changes to the app

 

Advantages of typescript




1.  Like babel typescript uses a compiler to write ES5 to the compiler
2. Typescript is a super set of ES6. 
3. Typescript adapts emerging standards like Decorators  
4. Class and Module Support
5. Static Type-checking
6. Build-in Support for JavaScript Packaging
7. Syntax Similarity to Our Backend Languages (Java)


Language support for Angular 2

Advantages of languages with type support


  • Interfaces and Types
  • Helps detect error when we type
  • Helps to gives us hints


Pipe character angular 2

A pipe takes in data as input and transforms it to a desired output.


Pipe character "|" helps to display the content

Examples of pipe

import { Component } from 'angular2/core';

@Component({
  selector: 'my-story',
  template: `
    <h3>{{story.name}}</h3>
    <h3 [innerText]="story.name"></h3>
    <div [style.color]="color">{{story.name}}</div>
    {{story| json}}
  `
})
export class StoryComponent {
  story = { id: 100, name: 'The Force Awakens' };
  color = 'blue';
}




Custom pipes


This custom pipe is used to perform sorting

Note:For the PipeTransform there is only one interface

Using the custom pipe in a template