Skip to content

Instantly share code, notes, and snippets.

Avatar

Ganaraj P R ganarajpr

View GitHub Profile
View LICENSE
The MIT License
Copyright (c) 2014 doxx (https://github.com/doxxx)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
View popover.html
<div class="popover {{ placement }}" ng-class="{ in: isOpen(), fade: animation() }">
<div class="arrow">
</div>
<div class="popover-inner">
<h3 class="popover-title" ng-bind="title" ng-show="title"></h3>
<div class="popover-content" ng-include="content"></div>
</div>
</div>
View popover.include.js
(function () {
var common = angular.module("common");
common.directive( 'popoverIncludePopup', function () {
return {
restrict: 'EA',
replace: true,
scope: { title: '@', content: '@', placement: '@', animation: '&', isOpen: '&' },
templateUrl: 'partials/directives/popover.html'
};
});
View ko-event2.html
<button data-bind="click: function(data, event) { onButtonClick('save',data, event) }">Save</button>
<button data-bind="click: function(data, event) { onButtonClick('cancel',data, event) }">Cancel</button>
View ko-event.html
<button data-bind="click : onButtonClick.bind($root,'save')">Save</button>
<button data-bind="click : onButtonClick.bind($root,'cancel')">Cancel</button>
View ang-event.js
$scope.onButtonClick = function(event,action){
// your code.
};
View ang-event.html
<button data-ng-click="onButtonClick($event,'save')">Save</button>
<button data-ng-click="onButtonClick($event,'cancel')">Cancel</button>
View ko-textjs.js
var myContent = ko.observable("Hello World");