Angular - Empty fiddle
Module with controller, filter, and directive.
by Rishi Kumar
HTML
<script src="https://code.angularjs.org/angular-1.0.1.js"></script>
<body ng-app="myApp" ng-controller="myCtrl">
<input ng-model="msg" />
<p my-dctv >
{{msg}}
</p>
</body>
JavaScript
// the main (app) module
var myApp = angular.module("myApp", []);
// add a controller
myApp.controller("myCtrl", function($scope,$http) {
$scope.msg = "hello world";
$scope.$on("$viewContentLoaded", function(e) {
})
// setTimeout(function(){
(function(){
console.log("called")
$scope.msg = "hello"
$scope.$apply();
})()
// },1000)
});
// add a filter
/*myApp.filter("myUpperFilter", function() {
return function(input) {
return input.toUpperCase();
}
});*/
// add a directive
/*myApp.directive("myDctv", function() {
return function(scope, element, attrs) {
element.bind("mouseenter", function() {
element.css("background", "yellow");
});
element.bind("mouseleave", function() {
element.css("background", "none");
});
}
});*/