This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct dataStruct { | |
var address = String() | |
var age = Int() | |
var balance = String() | |
var company = String() | |
var email = String() | |
var gender = String() | |
var name = String() | |
var phone = String() | |
var picture = String() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//casting result from alamofire API Call to struct | |
struct dataStruct { | |
var address = String() | |
var age = Int() | |
var balance = String() | |
var company = String() | |
var email = String() | |
var gender = String() | |
var name = String() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? { | |
let delete = UITableViewRowAction(style: .destructive, title: "Delete") { (action, indexPath) in | |
// delete item at indexPath | |
self.todo.remove(at: indexPath.row) | |
tableView.deleteRows(at: [indexPath], with: .fade) | |
} | |
let share = UITableViewRowAction(style: .default, title: "Share") { (action, indexPath) in | |
// share item at indexPath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@font-face { | |
font-family: 'Material Icons'; | |
font-style: normal; | |
font-weight: 400; | |
src: url("styles/font/MaterialIcons-Regular.eot"); | |
/* For IE6-8 */ | |
src: local("styles/font/Material Icons"), local("styles/font/MaterialIcons-Regular"), url("styles/font/MaterialIcons-Regular.woff2") format("woff2"), url("styles/font/MaterialIcons-Regular.woff") format("woff"), url("styles/font/MaterialIcons-Regular.ttf") format("truetype"); } | |
.material-icons { | |
font-family: 'Material Icons'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for the sake of the demonstration we are going to put all the code into one file, | |
// but I strongly encourage you to make your code as modular as possible | |
// also, please note that in a normal scenario, this function 'scrapeTheNews()' would be called from the index.js / starting point | |
// of your node app, because this is an async call, you would hve to wrap the inner part of the func inside a promise so that you | |
// would be able to retrieve the result in async from index.js | |
// if you want to see real world scenario with such wrapping please visit : https://github.com/jonathanmeguira/news-scraper | |
// useful to request/retrieve the page we want to scrape | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Injectable} from '@angular/core'; | |
import {BehaviorSubject} from 'rxjs/BehaviorSubject'; | |
@Injectable() | |
export class Monsters{ | |
private _monter: SubjectBehavior<string[]>; | |
constructor(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {Component, OnInit} from '@angular/core'; | |
import {Monsters} from './monsters'; | |
@Component({ | |
selector: 'monsters', | |
templateUrl: './monsters.component.html', | |
styleUrls: ['./monsters.component.css'] | |
}) | |
export class MonstersComponent implements OnInit { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"id": 1, | |
"name": "group1", | |
"desc": "description1", | |
"devices": [ | |
{ | |
"type": "device1", | |
"healthy": false, | |
"appliances": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class SomeClass { | |
public myArray = ['First Item', 'Second Item', 'Third Item']; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div *ngFor="let element of myArray"> | |
<input name="someName" [(ngModel)] = "element"> | |
</div> |
OlderNewer