Skip to content

Instantly share code, notes, and snippets.

View Yogendra0Sharma's full-sized avatar
🎯
Focusing

Yogendra Sharma Yogendra0Sharma

🎯
Focusing
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Yogendra0Sharma
Yogendra0Sharma / Data_and_databases.ipynb
Created January 12, 2017 11:31 — forked from jonathanmorgan/Data_and_databases.ipynb
Data and databases - SQL and Python
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Given a controller that uses the $location service

'use strict';

/**
 * @ngdoc function
 * @name categoryManagerApp.controller:CategoryCtrl
 * @description
 * # CategoryCtrl
 * Controller of the categoryManagerApp
@Yogendra0Sharma
Yogendra0Sharma / basic-modal-in-angular-with-uibootstrap.md
Created January 12, 2017 11:36 — forked from coreypnorris/basic-modal-in-angular-with-uibootstrap.md
Create a basic modal in Angular using ui.bootstrap
  • Install angular-bootstrap via bower bower install angular-bootstrap --save
  • In app/scripts/app.js add ui.bootstrap as a dependency
angular
  .module('categoryManagerApp', [
    'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngRoute',
    'ngSanitize',

Basic directive

  • Run generator command yo angular:directive myDirective.
  • Run gulp test to ensure tests pass.

Refactor to handle passed-in objects

Given you want to pass in the following object {realName:'Steve Rogers', alias:'Captain America'}
  • Add scope property to the app/scripts/directives/mydirective.js file.
'use strict';
@Yogendra0Sharma
Yogendra0Sharma / ng-notes.md
Created January 12, 2017 11:39 — forked from underhilllabs/ng-notes.md
notes on angularJS

controllers

Controller Responsibilities

  • responsible for setting up initial state of scope object
  • responsible for adding behavior to that scope object

Attaching the controller

<div id=masterWrapper ng-controller="MainCtrl">