小编Sar*_*ara的帖子

带有角度JS的可编辑文本就像普通链接一样

你能帮助我在这里做错吗?

我使用xeditable和angular在我的一个表单中实现了一个带有角度js的可编辑标签,但奇怪的是可编辑标签就像一个普通的链接,我按照这个文档

https://vitalets.github.io/angular-xeditable/

这是我的相关HTML代码

        <a href="#"  editable-text="user.name">{{ user.name || "empty" }}</a>
    
Run Code Online (Sandbox Code Playgroud)

我插入角度js控制器和一切,我得到没有错误只是它像一个普通的链接.

编辑我的app.js看起来像

'use strict';

var App = angular.module('myApp', [
                               'ngResource',
                               'ngRoute',
                               'ngFileUpload',
                               'angularBootstrapNavTree',
                               'ngAnimate',
                               'angularUtils.directives.dirPagination',
                               "checklist-model",
                               'xeditable'


                             ]);



 //comment
App.config(['$routeProvider','paginationTemplateProvider', function($routeProvider,paginationTemplateProvider) {
 ......

}]);

App.run(['$rootScope','$location','$routeParams','$http','Attribut','Categorie','SsCategorieofcategorie','Produit','ConfigCategorie','editableOptions', function($rootScope, $location, $routeParams, $http, Attribut, Categorie,SsCategorieofcategorie,Produit,ConfigCategorie,editableOptions) {
	  editableOptions.theme = 'bs3';
........

    }]);
Run Code Online (Sandbox Code Playgroud)

而我的控制器:

'var strict';

App.controller('GenerationContenuController',['$scope', '$http','$interval','GenerationContenu','InputText','$timeout',  function($scope, $http,$interval,GenerationContenu,InputText ,$timeout){

	   var self=this;
    
    	   $scope.user = {
    	     name: 'awesome user'
    	   };



...



}]);
Run Code Online (Sandbox Code Playgroud)

最后是html

<form id="msform"  ng-controller="GenerationContenuController as ctrl"  editable-form>
  <!-- progressbar -->
  <ul id="progressbar">
    <li …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs x-editable

5
推荐指数
1
解决办法
1093
查看次数

标签 统计

angularjs ×1

javascript ×1

x-editable ×1