Skip to content

Instantly share code, notes, and snippets.

View ttsvetko's full-sized avatar
:octocat:
Working from home

Tsvetan Tsvetkov ttsvetko

:octocat:
Working from home
View GitHub Profile
@ttsvetko
ttsvetko / angular-directives.adoc
Created September 25, 2018 07:03
Angular Directives - Lesser Known

Lesser know AngularJS directives

Lesser know AngularJS directives

One of the most awesome things in angular is its approach towards creating reusable HTML attributes and elements

@ttsvetko
ttsvetko / angularinterceptor.adoc
Created September 25, 2018 07:02
XHR Interceptor in an AngularJS web app
@ttsvetko
ttsvetko / angular-structuring.adoc
Created September 25, 2018 07:02
Recommendations for Angular App Structure

Recommendations for Angular App Structure

Proposal:

Change angular-seed, yeoman/generator-angular, (the Google-internal example go/nghellostyle), and other demo apps to model the following directory structure. Eventually, develop tooling to make development more efficient using assumptions based on these conventions.

@ttsvetko
ttsvetko / di.adoc
Created September 25, 2018 07:02
Angular Dependency Injection

Angular Dependency Injection

@ngdoc overview @name Dependency Injection @description

Dependency Injection (DI) is a software design pattern that deals with how code gets hold of its dependencies.

The Angular injector subsystem is in charge of service instantiation, resolution of dependencies, and provision of dependencies to components as requested.

@ttsvetko
ttsvetko / angular-jqlite.adoc
Created September 25, 2018 07:02
Angular jqLite

Angular jqLite

jQuery and Angular

Angular doesn’t depend on jQuery. In fact, the Angular source contains an embedded lightweight alternative: jqLite. Still, when Angular detects the presence of a jQuery version in your page, it uses that full jQuery implementation in lieu of jqLite. One direct way in which this manifests itself is with Angular’s element abstraction. For example, in a directive you get access to the element that the directive applies to:

@ttsvetko
ttsvetko / function.adoc
Created September 25, 2018 07:02
Javascript Function Scope

Functions and function scope

Summary

Generally speaking, a function is a "subprogram" that can be called by code external (or internal in the case of recursion) to the function. Like the program itself, a function is composed of a sequence of statements called the function body. Values can be passed to a function, and the function can return a value.

In JavaScript, functions are first-class objects, i.e. they are objects and can be

Improving Your JavaScript

Introduction

JavaScript has evolved over the years and there are things that can be done with JavaScript now that couldn’t be done a few years ago. These tutorials present ways in which you can take existing JavaScript from a while ago and rework them to make better use of the newer features that are now available.

@ttsvetko
ttsvetko / styles.css
Created September 25, 2018 07:02
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@ttsvetko
ttsvetko / essential-javascript-links.md
Created September 25, 2018 07:02
Essential JavaScript Links