首页 \ 问答 \ post [object%20Object] 404找不到angularjs(post [object%20Object] 404 not found angularjs)

post [object%20Object] 404找不到angularjs(post [object%20Object] 404 not found angularjs)

嗨我想在mi表中插入一行,但总是会遇到这个问题:

POST URL / api / presentaciones / [object%20Object] 404(未找到)

好吧,我在控制器中有一个表格和ng-submit =“savePresentacion”:

.controller('newPresentacionController', function ($scope, Presentacion, Categoria) {
             $scope.categorias ={};
             var vm = this;
             var presentacionData = {};
             $scope.savePresentacion = function() {
                 presentacionData = {
                     nombre : $scope.nombre,
                     descripcion : $scope.descripcion,
                     tipo_presentacion : $scope.tipo_presentacion,
                     usuarios_id : $scope.usuarios_id,
                     categorias_id: $scope.categorias_id,
                     longitude: self.myMarker.position.lng(),
                     latitud: self.myMarker.position.lat(),
                     zoom: 13
                 };
                 Presentacion.crearPresentacion(presentacionData).success(function (datos) {

                 });
             };
}

在presentacionService有这个:

(function () {
    angular.module('presentacionService', [])
        .factory('Presentacion', function ($http) {
            var presentacionFactory = {};
            presentacionFactory.crearPresentacion = function(presenData) {
                console.log(presenData);
                return $http.post('/api/presentaciones/' + presenData);
            };
            return presentacionFactory;
        });
})();

在此之后提出问题。 我做了同样的2桌更多没有问题这个部分有问题。


hi i am trying to insert a row in mi table but always obtain this problem:

POST URL/api/presentaciones/[object%20Object] 404 (Not Found)

Well I have a form and the ng-submit="savePresentacion" inthe controller:

.controller('newPresentacionController', function ($scope, Presentacion, Categoria) {
             $scope.categorias ={};
             var vm = this;
             var presentacionData = {};
             $scope.savePresentacion = function() {
                 presentacionData = {
                     nombre : $scope.nombre,
                     descripcion : $scope.descripcion,
                     tipo_presentacion : $scope.tipo_presentacion,
                     usuarios_id : $scope.usuarios_id,
                     categorias_id: $scope.categorias_id,
                     longitude: self.myMarker.position.lng(),
                     latitud: self.myMarker.position.lat(),
                     zoom: 13
                 };
                 Presentacion.crearPresentacion(presentacionData).success(function (datos) {

                 });
             };
}

in the presentacionService have this:

(function () {
    angular.module('presentacionService', [])
        .factory('Presentacion', function ($http) {
            var presentacionFactory = {};
            presentacionFactory.crearPresentacion = function(presenData) {
                console.log(presenData);
                return $http.post('/api/presentaciones/' + presenData);
            };
            return presentacionFactory;
        });
})();

after of this give the problem. I did the same with 2 tables more and dont have problem just have problem with this part.


原文:https://stackoverflow.com/questions/34147041
更新时间:2024-02-06 08:02

最满意答案

我已更新您的代码以使其工作:

<div style="position:absolute;top:40%;left:0%;width:100%;">
  <div id="posts "style="position:relative;width:100%;">
    <div style="display:table; width:100%;">
     <div style="display:table-cell;vertical-align: middle;width:100%;height:100px;position:relative;text-indent: 1.5em;text-align:center;">test

   </div>
  </div>
</div>

你需要的是添加一个显示表格的div,并将所有包含元素设置为100%宽度。 你所居中的div需要一个text-align:center。


I have updated your code to get it to work:

<div style="position:absolute;top:40%;left:0%;width:100%;">
  <div id="posts "style="position:relative;width:100%;">
    <div style="display:table; width:100%;">
     <div style="display:table-cell;vertical-align: middle;width:100%;height:100px;position:relative;text-indent: 1.5em;text-align:center;">test

   </div>
  </div>
</div>

What you needed was to add a div with display: table in and set all the containing elements to 100% width. Also the div you are centring needed a text-align: center.

相关问答

更多
  • 只需添加margin: 0 auto; ..工作正常。 html { display: table; height: 100%; width: 100%; text-align: center; } body { display: table-cell; vertical-align: middle; } .hidden { display: none; } .leaf { border-radius: 15px 2px 15px 2px; ...
  • 一种解决方案是为.price-list , .price-list > li提供100%的高度。和.price-wrapper将使子高度适合内容。 .price-list { display: table; height: 100%; //Here list-style: outside none none; margin: 0; padding: 0; table-layout: fixed; width: 100%; } .price-list ...
  • 我已更新您的代码以使其工作:
    使用box-sizing: border-box; 在.selected 。 这是一个奇迹工作者: $(".table-cell").click(function() { $(".selected").removeClass("selected"); $(this).addClass("selected"); }); body { font-family: "Helvetica", "Open-sans", "sans-serif"; } .main-container { h ...
  • 相关文章

    更多
  • Object Oriented Programming
  • Cannot expose request attribute 'website' because of an existing model object of the same name 的解决方案
  • springmvc处理404异常
  • AngularJS资源
  • Guava学习笔记:复写的Object常用方法
  • httpclient post 请求
  • 2013年度最强AngularJS资源合集
  • howto:solr post.jar使用
  • 【JavaScript】 2013年度最强AngularJS资源合集
  • httpclient post 表单参数请求
  • 最新问答

    更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)