Skip to content

Instantly share code, notes, and snippets.

View squadwuschel's full-sized avatar
💭
Working

SquadWuschel squadwuschel

💭
Working
  • Relaxdays
  • Germany
View GitHub Profile
@squadwuschel
squadwuschel / nameof.cs
Created November 27, 2016 12:15
Nameof Beispiel
class Program
{
static void Main(string[] args)
{
var personNamePropertyName = nameof(Person.Name);
Console.WriteLine($"Der Name des Properties ist: {personNamePropertyName}");
}
}
public class Person
@squadwuschel
squadwuschel / person.cs
Created November 27, 2016 12:21
Property Initialisierung C# 6
public class Person
{
public string Name { get; set; } = string.Empty;
public string Vorname { get; set; } = string.Empty;
public int Alter { get; set; } = 21;
public List<string> Spitznamen { get; set; } = new List<string>();
public string Anzeigename => $"{Vorname}, {Name}";
}
@squadwuschel
squadwuschel / elvisopertator.cs
Created November 27, 2016 12:30
ElvisOperator beispiel
public string Searchnames(List<string> namen)
{
var result = string.Empty;
if (namen?.Count > 0)
{
//do somethig
}
return result;
}
@squadwuschel
squadwuschel / package.json
Created December 7, 2016 08:07
npm Scripts
{
"scripts": {
"start": "webpack-dev-server --inline --progress --port 8080"
},
"dependencies": {
"@angular/common": "~2.2.0",
"@angular/compiler": "~2.2.0",
...
}
@squadwuschel
squadwuschel / vendors.ts
Created December 7, 2016 08:29
Angular 2 webpack vendors.ts
// Angular
import '@angular/platform-browser';
import '@angular/platform-browser-dynamic';
import '@angular/core';
import '@angular/common';
import '@angular/forms';
import '@angular/http';
import '@angular/router';
@squadwuschel
squadwuschel / polyfills.ts
Created December 7, 2016 09:10
Angular 2 webpack polyfills
import 'core-js/es6/symbol';
import 'core-js/es6/object';
import 'core-js/es6/function';
import 'core-js/es6/parse-int';
import 'core-js/es6/parse-float';
import 'core-js/es6/number';
import 'core-js/es6/math';
import 'core-js/es6/string';
import 'core-js/es6/date';
import 'core-js/es6/array';
@squadwuschel
squadwuschel / boot.ts
Created December 7, 2016 09:11
Angular 2 Webpack 2 boot.ts
/// <reference path="../typings/index.d.ts" />
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { AppModule } from './app.module';
const platform = platformBrowserDynamic();
platform.bootstrapModule(AppModule);
@squadwuschel
squadwuschel / webpack.dev.js
Created December 7, 2016 10:34
Angular 2 mit webpack 2 dev Einstellungen
var helpers = require('./helpers');
var webpackMerge = require('webpack-merge'); // used to merge webpack configs
var commonConfig = require('./webpack.common.js'); // the settings that are common to prod and dev
/**
* Webpack Plugins
*/
var DefinePlugin = require('webpack/lib/DefinePlugin');
var LoaderOptionsPlugin = require('webpack/lib/LoaderOptionsPlugin');
var WebpackNotifierPlugin = require('webpack-notifier');
@squadwuschel
squadwuschel / index.html
Created December 7, 2016 10:42
Compillierte index.html im wwwroot für Angular 2 mit webpack 2
<!DOCTYPE html>
<html lang="de">
<head>
<title>Angular2 Mit WebPack 2</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<!-- base url -->
@squadwuschel
squadwuschel / RouteConfig.cs
Created December 7, 2016 10:51
RouteConfig für Angular 2 mit webpack 2
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }