Skip to content

Instantly share code, notes, and snippets.

View duycuong87vn's full-sized avatar
🌴
On vacation

hydrogen duycuong87vn

🌴
On vacation
View GitHub Profile
var productCtrl = angular.module('productCtrl', []);
productCtrl.controller('fashionCtrl', ['$scope', '$http',
function($scope, $http) {
$http.get('js/temporaryData/fashions.json').success(function(data) {
$scope.fashions = data;
});
}
]);
@duycuong87vn
duycuong87vn / jsbin.sekob.html
Created April 11, 2014 22:12
Depedency inject ( MathService , CaculatorService, Controller ) CaculatorService has dependency on MathService and use multiply method . MathServices is custom service : 4 method
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>CaculatorApp with DI_Services_Controller</title>
</head>
<body>
<div data-ng-app="app">
<div data-ng-controller="CalculatorCtrl">
.show-scope-demo.ng-scope,
.show-scope-demo .ng-scope{
border: 1px solid red;
margin: 3px;
}
<!DOCTYPE html>
<html data-ng-app="docsSimpleDirective">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>AngularJS Example</title>
</head>
<body>
<div data-ng-controller="Ctrl1">
<div data-my-customer></div>
<!DOCTYPE html>
<html data-ng-app="docsBindExample">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>AngularJS Example</title>
</head>
<body>
<div data-ng-controller="Ctrl1">
<br />
<!DOCTYPE html>
<html data-ng-app="">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>AngularJS review</title>
</head>
<body>
<div data-ng-controller="SimpleController">
Enter name :
function EventController($scope){
$scope.count = 0;
$scope.$on('MyEvent', function(){
$scope.count++;
});
}
.show-scope-demo.ng-scope,
.show-scope-demo .ng-scope{
border: 1px solid red;
margin: 5px;
}
.show-scope-demo.ng-scope,
.show-scope-demo .ng-scope{
border: 1px solid red;
margin: 3px;
}
<!DOCTYPE html>
<html ng-app>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.14/angular.min.js"></script>
<meta charset="utf-8">
<title>AngularJS review</title>
</head>
<body>
<div ng-controller="MyController">
Your name: