@@ -4,6 +4,9 @@ app.run(function($rootScope, $location) {
});
+app.run(['editableOptions', function(editableOptions) {
+ editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default'
+}]);
app.config(['$translateProvider', function($translateProvider) {
// var translations = {
// en: {
@@ -2,5 +2,6 @@ window.app = angular.module('fea5', [
'ngRoute',
'ui.bootstrap',
'cgNotify',
+ 'xeditable',
'pascalprecht.translate'
]);
@@ -16,6 +16,12 @@
// message: 'her na lob',
// type: 'danger'
// })
+ $scope.user = {
+ name: 'awesome user'
+ };
+ $scope.updateUser = function(){
+ console.log($scope.user)
}])
})();
@@ -1,4 +1,7 @@
<h2 class="page-header">Athors</h2>
+
+<a href="#" editable-text="user.name" onaftersave='updateUser()'>{{ user.name || "empty" }}</a>
<table class="table table-hover">
<thead>
<th>Firstname</th>
@@ -10,7 +13,7 @@
<th class="float-right">
<button class="btn-danger btn-xs pull-right" ng-click="deteteAuthor(author)"><i class="glyphicon glyphicon-trash"></i></button>
<button class="btn-warning btn-xs pull-right"><i class="glyphicon glyphicon-pencil"></i></button>
-
</th>
</tbody>
-</table>
+</table>
@@ -7,6 +7,7 @@
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="./app/directive/lang-swicher/lang-swicher.css">
+ <link rel="stylesheet" href="./node_modules/angular-xeditable/dist/css/xeditable.min.css">
</head>
<body ng-controller="Main">
<div class="container">
@@ -20,8 +20,8 @@
"style-loader": "^0.21.0"
},
"bundleDependencies": [
- "@cgross/angular-notify",
"angular",
+ "@cgross/angular-notify",
"angular-route",
"angular-translate",
"angular-translate-loader-static-files",