| 
 | 1 | +import { Component } from '@angular/core';  | 
 | 2 | + | 
 | 3 | +@Component({  | 
 | 4 | + selector: 'app-root',  | 
 | 5 | + templateUrl: './app.component.html',  | 
 | 6 | + styleUrls: ['./app.component.css']  | 
 | 7 | +})  | 
 | 8 | +export class AppComponent {  | 
 | 9 | + title = 'myangularproject';  | 
 | 10 | + public toggleSidebar: boolean=true;  | 
 | 11 | + | 
 | 12 | + public listFields = { id:"id", text: "text"}  | 
 | 13 | + | 
 | 14 | + public listData: object = [  | 
 | 15 | + { id: "1", text: "JavaScript",   | 
 | 16 | + description: "JavaScript (JS) is an interpreted computer programming language. " +  | 
 | 17 | + "It was originally implemented as part of web browsers so that client-side scripts" +   | 
 | 18 | + "could interact with the user, control the browser, communicate asynchronously, and" +  | 
 | 19 | + "alter the document content that was displayed. However, it has recently" +  | 
 | 20 | + "become common in both game development and the creation of desktop applications." },  | 
 | 21 | + { id: "2", text: "TypeScript",   | 
 | 22 | + description: "It is a typed superset of JavaScript that compiles to plain JavaScript." +   | 
 | 23 | + "TypeScript is an open-source, object-oriented programing language. It contains all elements of JavaScript" +   | 
 | 24 | + "It is a language designed for large-scale JavaScript application development, which can be executed on any" +   | 
 | 25 | + "browser, any Host, and any Operating System. TypeScript is a language as well as a set of tools." +  | 
 | 26 | + " TypeScript is the ES6 version of JavaScript with some additional features." },  | 
 | 27 | + { id: "3", text: "Angular",   | 
 | 28 | + description: "Angular is a platform and framework for building single-page client applications using HTML and TypeScript." +  | 
 | 29 | + " Angular is written in TypeScript. It implements core and optional functionality as a set of TypeScript" +  | 
 | 30 | + " libraries that you import into your applications." },  | 
 | 31 | + { id: "4", text: "React",  | 
 | 32 | + description: "React is a declarative, efficient, and flexible JavaScript library for building user interfaces." +  | 
 | 33 | + " It lets you compose complex UIs from small and isolated pieces of code called "components"." +  | 
 | 34 | + " It can also render on the server using Node." },  | 
 | 35 | + { id: "5", text: "Vue",   | 
 | 36 | + description: "A progressive framework for building user interfaces. It is incrementally adoptable." +  | 
 | 37 | + " The core library is focused on the view layer only and is easy to pick up and integrate with other" +  | 
 | 38 | + " libraries or existing projects. On the other hand, Vue is also perfectly capable of powering" +  | 
 | 39 | + " sophisticated Single-Page Applications when used in combination with modern tooling and supporting libraries." }  | 
 | 40 | + ]  | 
 | 41 | + | 
 | 42 | + public menuBtnClk(){  | 
 | 43 | + this.toggleSidebar = !this.toggleSidebar;  | 
 | 44 | + }  | 
 | 45 | + | 
 | 46 | + public onSelect(args:any){  | 
 | 47 | + let mainContent = document.getElementsByClassName("main-content")[0];  | 
 | 48 | + if(mainContent){  | 
 | 49 | + mainContent.innerHTML = args.data.description;  | 
 | 50 | + }  | 
 | 51 | + }  | 
 | 52 | +}  | 
0 commit comments