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
最满意答案
我已更新您的代码以使其工作:
<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
withdisplay: table
in and set all the containing elements to100% width
. Also thediv
you are centring needed atext-align: center
.
相关问答
更多-
这是由浏览器实现的自动表格布局算法的结果。 这可能因浏览器而异,因为CSS2.1规范没有指定所有的自动布局行为 ,但它确实提出了浏览器通常使用HTML表格的算法,因为CSS表格模型大部分基于HTML表格模型。 一般来说,如果表格没有指定的宽度(即它使用默认的auto ),那么具有百分比宽度的单元格与其内容所要求的一样宽,并且不再有。 计算出的宽度(与其他单元格上指定的任何其他宽度一起)将用作查找整个表的最大宽度的百分比,其余列的大小将相应调整。 请注意,该表仍然可以受其包含块的约束(在您的示例中,它是由结果 ...
-
为什么width:100%不能在div {display:table-cell}上工作?(Why is width: 100% not working on div {display: table-cell}?)[2023-09-29]
放置display:table; 里面.outer-wrapper似乎工作... JSFiddle链接 编辑:使用显示表格单元格的两个包装器 我会评论你的答案,但我有太少的rep :(反正... 去掉你的答案 ,好像所有你需要做的是添加display:table; 里面的.outer-wrapper (Dejavu?),你可以.outer-wrapper摆脱table-wrapper 。 的jsfiddle 但是,这个position:absolute可以让div放在img ,我读得太快了,以为你根本就不能 ... -
永远不要使用表格式进行布局! 特别是不与位置相结合! 继承人如何在没有表格布局的情况下修复它: 从#content删除display: table 从#index删除display: table-row 删除position: fixed从#index .nav-container position: fixed 在#index .nav-container和#index .page-content ,执行以下操作: 删除display: table-cell 添加float: left 加height: ...
-
罪魁祸首是float: left 。 删除它解决了这个问题。 html,body{width:100%;margin:0} .col { width:966px; display:table; } .ttl { width: 571px; background: red; } .otr { width: 255px; background: blue;} .ttl, .otr { margin-left:20px; padding:20px; display: tabl ...
-
为了使它工作,我们必须使用position:relative表格和位置:绝对表格单元格项目。 同样在你的代码中,我删除了容器的高度:100%是没用的。 这是预览和小提琴 。 .table{ display: table; table-layout: fixed; width: 100%; height:200px; position: relative; } .cell{ display: table-cell; vertic ...
-
-
只需添加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 ...
-
display:table-cell无法正常工作,宽度为100%(display:table-cell doesn't work properly with 100% width)[2022-05-19]
我已更新您的代码以使其工作:使用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)