Warsaw, Poland
tomandquery@gmail.com

ANGULAR

Iterate over object and array
4.08.2018

Iterate over object and array

var obj = { name: “Tom”, age: “30”, hobbies: { photography: “nature”, isHappy: true }, array: [1, ‘one’, true] } for (var property in obj) { if (obj.hasOwnProperty(property)) { console.log(obj[property]); } } Object.keys(obj).forEach(function(key, index, value)...
Read more

Gulp with angular sample file, less, jasmin

var gulp = require('gulp'); var plugins = require('gulp-load-plugins')(); var rimraf = require('rimraf'); var paths = { less: ['./less/*.less'], js: ['./js/app/*.js', './js/app/**/*.js'], jsView: ['./js/app/views/*.html'], dist: { css: './public/css/', js: './public/js/', jsView: './public/views', }, vendor: { css:...
Read more

Angular service to transform polish characters, letters, signs

'use strict'; angular.module('form-meet-agent').service('transformAccents',[ function (s) { this.getTransformed = function (s){ return s .replace(/ą/gi, 'a') .replace(/ę/gi, 'e') .replace(/ó/gi, 'o') .replace(/ń/gi, 'n') .replace(/ś/gi, 's') .replace(/ż/gi, 'z') .replace(/ź/gi, 'z') .replace(/ć/gi, 'c') .replace(/ł/gi, 'l') .replace(/\s/gi, '_') .toLowerCase(); }; }...
Read more

Angular – notes

  npm install angular npm install -g @angular/cli ng help ng new PROJECT-NAME ng serve ng serve --host 0.0.0.0 --port 4201 ng serve --open ng generate component my-new-component ng g component my-new-component # using the alias  # components support relative path generation  # if in the directory src/app/feature/ and you run  ng g component new-cmp # your component will be generated in src/app/feature/new-cmp  # but if you were to run  ng g component ../newer-cmp # your component will be generated in src/app/newer-cmp  # if in the directory src/app you can also run  ng g component feature/new-cmp # and your component will be generated in src/app/feature/new-cmp  Component: ng g component my-new-component Directive: ng g directive my-new-directive Pipe: ng g...
Read more