X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=sdnc-a1-controller%2Foam%2Fconfigbackuprestore%2Fvnfconfigbackupservice%2Fsrc%2Fmain%2Fwebapp%2Fnode_modules%2Fangular-object-diff%2FREADME.md;fp=sdnc-a1-controller%2Foam%2Fconfigbackuprestore%2Fvnfconfigbackupservice%2Fsrc%2Fmain%2Fwebapp%2Fnode_modules%2Fangular-object-diff%2FREADME.md;h=bc3190d16f2495ee5f7063a58c28f1db0fef873a;hb=b6fe5a1bbad372357f6b441e1657dd8bbe48dc1a;hp=0000000000000000000000000000000000000000;hpb=4e0c72d8a2570e256911eab7cc34f770a1aa327a;p=nonrtric.git diff --git a/sdnc-a1-controller/oam/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angular-object-diff/README.md b/sdnc-a1-controller/oam/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angular-object-diff/README.md new file mode 100644 index 00000000..bc3190d1 --- /dev/null +++ b/sdnc-a1-controller/oam/configbackuprestore/vnfconfigbackupservice/src/main/webapp/node_modules/angular-object-diff/README.md @@ -0,0 +1,121 @@ +# angular-diff +An Angular JS plugin to compare and show object differences in JSON format. [Demo](http://hipster-labs.github.io/angular-object-diff/) + +![Screenshot](/screenshot.png) +# Installation + +with bower +``` +bower install angular-object-diff --save +``` + +``` + + +``` + +or with npm +``` +npm i angular-object-diff +``` + +# Available methods on `ObjectDiff` service + + +`setOpenChar`: set the opening character for the view, default is `{` + +`setCloseChar`: set the closing character for the view, default is `}` + +`diff`: compare and build all the difference of two objects including prototype properties + +`diffOwnProperties`: compare and build the difference of two objects taking only its own properties into account + +`toJsonView`: format a diff object to a full JSON formatted object view + +`toJsonDiffView`: format a diff object to a JSON formatted view with only changes + +`objToJsonView`: format any javascript object to a JSON formatted view + + +# Available filters + +`toJsonView`: format a diff object to a full JSON formatted object view + +`toJsonDiffView`: format a diff object to a JSON formatted view with only changes + +`objToJsonView`: format any javascript object to a JSON formatted view + + +# Usage + +Declare the dependency +``` +angular.module('myModule', ['ds.objectDiff']); + +``` + +Inject the service + +```javascript +angular.module('myModule') + .controller('MyController', ['$scope', 'ObjectDiff', function($scope, ObjectDiff){ + $scope.yourObjectOne = {//all your object attributes and values here}; + $scope.yourObjectTwo = {//all your object attributes and values here}; + + // This is required only if you want to show a JSON formatted view of your object without using a filter + $scope.yourObjectOneJsonView = ObjectDiff.objToJsonView($scope.yourObjectOne); + $scope.yourObjectTwoJsonView = ObjectDiff.objToJsonView($scope.yourObjectTwo); + + // you can directly diff your objects js now or parse a Json to object and diff + var diff = ObjectDiff.diffOwnProperties($scope.yourObjectOne, $scope.yourObjectTwo); + + // you can directly diff your objects including prototype properties and inherited properties using `diff` method + var diffAll = ObjectDiff.diff($scope.yourObjectOne, $scope.yourObjectTwo); + + // gives a full object view with Diff highlighted + $scope.diffValue = ObjectDiff.toJsonView(diff); + + // gives object view with onlys Diff highlighted + $scope.diffValueChanges = ObjectDiff.toJsonDiffView(diff); + + }]); +``` + +Bind the variables directly in your html using the `ng-bind-html` angular directive. +Use a `
` element for better results
+
+```html
+

+

+

+

+```
+
+The same can be done with filters as well
+
+```javascript
+angular.module('myModule')
+    .controller('MyController', ['$scope', 'ObjectDiff', function($scope, ObjectDiff){
+        $scope.yourObjectOne = {//all your object attributes and values here};
+        $scope.yourObjectTwo = {//all your object attributes and values here};
+
+        // you can directly diff your objects js now or parse a Json to object and diff
+        var diff = ObjectDiff.diffOwnProperties($scope.yourObjectOne, $scope.yourObjectTwo);
+        
+        // you can directly diff your objects including prototype properties and inherited properties using `diff` method
+        var diffAll = ObjectDiff.diff($scope.yourObjectOne, $scope.yourObjectTwo);
+    
+    }]);
+```
+
+Bind the variables directly in your html using the `ng-bind-html` angular directive.
+Use a `
` element for better results
+
+```html
+

+

+

+

+```
+
+Inspired from https://github.com/NV/objectDiff.js