$ location.path(“/”);($location.path(“/”); not working properly)
当我尝试使用$ location.path()时,url会发生变化但是我传入的内容.path会被添加到我当前的url中。 我希望当我执行我的addShow()时,我想去index.html这是我的主页。 能否请你帮忙。 网址改变如下: http:// localhost:8080 / add ,当我执行我的addShow函数时,它更改为: http:// localhost:8080 / add#/我希望它更改为转到我的主页。
angular.module('app').controller("MainController",['$location', function($location) { var vm = this; vm.title = 'TV Show'; vm.searchInput = ''; vm.shows = [{ title: 'Game of Thrones', year: 2011, favorite: true }, { title: 'Walking Dead', year: 2010, favorite: false }, { title: 'Firefly', year: 2002, favorite: true }, { title: 'Banshee', year: 2013, favorite: true }, { title: 'Greys Anatomy', year: 2005, favorite: false }]; vm.orders = [{ id: 1, title: 'Year Ascending', key: 'year', reverse: false }, { id: 2, title: 'Year Descending', key: 'year', reverse: true }, { id: 3, title: 'Title Ascending', key: 'title', reverse: false }, { id: 4, title: 'Title Descending', key: 'title', reverse: true }]; vm.order = vm.orders[0]; vm.new = {}; vm.addShow = function() { vm.shows.push(vm.new); console.log(vm.shows); vm.new = {}; $location.path("/"); }; }]);
我的配置功能如下:
(function() { "use strict"; angular .module("app") .config(function($routeProvider, $locationProvider) { //$locationProvider.html5Mode(true); $routeProvider .when('/', { templateUrl: 'list.html', controller: 'MainController', controllerAs: 'main', }) .when('/add', { templateUrl: 'add.html', controller: 'MainController', controllerAs: 'main', }) ; }); })();
When I am trying to use $location.path(), the url changes but whatever I have passed in .path is appened to my current url. I want that when I execute my addShow(), I want to go to index.html which is my home page. Could you please help. The url changes like this: http://localhost:8080/add and when I execute my addShow function it changes to: http://localhost:8080/add#/ I want it to change to go to my home page.
angular.module('app').controller("MainController",['$location', function($location) { var vm = this; vm.title = 'TV Show'; vm.searchInput = ''; vm.shows = [{ title: 'Game of Thrones', year: 2011, favorite: true }, { title: 'Walking Dead', year: 2010, favorite: false }, { title: 'Firefly', year: 2002, favorite: true }, { title: 'Banshee', year: 2013, favorite: true }, { title: 'Greys Anatomy', year: 2005, favorite: false }]; vm.orders = [{ id: 1, title: 'Year Ascending', key: 'year', reverse: false }, { id: 2, title: 'Year Descending', key: 'year', reverse: true }, { id: 3, title: 'Title Ascending', key: 'title', reverse: false }, { id: 4, title: 'Title Descending', key: 'title', reverse: true }]; vm.order = vm.orders[0]; vm.new = {}; vm.addShow = function() { vm.shows.push(vm.new); console.log(vm.shows); vm.new = {}; $location.path("/"); }; }]);
my config function is as below:
(function() { "use strict"; angular .module("app") .config(function($routeProvider, $locationProvider) { //$locationProvider.html5Mode(true); $routeProvider .when('/', { templateUrl: 'list.html', controller: 'MainController', controllerAs: 'main', }) .when('/add', { templateUrl: 'add.html', controller: 'MainController', controllerAs: 'main', }) ; }); })();
原文:https://stackoverflow.com/questions/34012071
满意答案
要从第15行读取,请修改您的查询以使用表名作为FROM
[Sheet1$A15:ZZ]
-var query = string.Format("select [Col1],[Col2],[Col3] from [{0}${1}]", "Sheet1","A15:ZZ");
A15表示标题行。
确保在连接字符串中设置了
"HDR=YES"
。To read from 15th row, modify your query to use table name as FROM
[Sheet1$A15:ZZ]
-var query = string.Format("select [Col1],[Col2],[Col3] from [{0}${1}]", "Sheet1","A15:ZZ");
A15 represents header row.
Make sure that you have set
"HDR=YES"
in your connection string.
相关问答
更多如何删除excel中的所有行,除了c#中的头文件(How to delete all rows from excel except header in c#)
从C#读取Excel文件(Reading Excel files from C#)
C# - 如何从excel获取标题到datagridview?(C# - How to get the header from excel into datagridview?)
如何使用openXML C#将文件excel行和表格特定的读取到数据表中(How to read file excel row and sheet specific using openXML C# into data table)
从C#读取Excel文件(Reading an Excel File From C#)
在c#中读取excel(.xlsx)文件(reading excel (.xlsx) file in c#)
C#读取excel文件,其中标题不是第一行(C# reading excel file where the header is not the first row)
使用带错位的标题行的C#读取Excel文件(Reading an Excel file with C# with misplaced header row)
逐行读取excel文件,逐个单元格C#(Read excel file row by row, cell by cell C#)
用c#读取excel文件(Read excel file with c#)
相关文章
更多Working on Free Software
nginx配置中location的优先级
启动Solr服务报错:Path must not end with / character
Eclipse中Hadoop的DFS Location无法显示DFS下的文件 解决方法
Hadoop格式化失败原因 Format aborted in path
RFC2848--The PINT Service Protocol: Extensions to SIP and SDP for IP Access to Telephone Call Services
微软职位内部推荐-Senior SDE
DataDir and DirectoryFactory in SolrConfig
Solr_stopword相关注意事项
最新问答
更多python的访问器方法有哪些
使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
透明度错误IE11(Transparency bug IE11)
linux的基本操作命令。。。
响应navi重叠h1和nav上的h1链接不起作用(Responsive navi overlaps h1 and navi links on h1 isn't working)
在C中读取文件:“r”和“a +”标志的不同行为(Reading a File in C: different behavior for “r” and “a+” flags)
NFC提供什么样的带宽?(What Kind of Bandwidth does NFC Provide?)
元素上的盒子阴影行为(box-shadow behaviour on elements)
它看起来像只在Windows上的Chrome的错误。 我在Google Canary (Chrome 63)中也进行了测试,问题依然存在,所以有可能它不会很快修复。 这个问题是由overflow: auto引起的overflow: auto ,在你的情况下,它可以很容易地通过删除或设置为可见(默认)来解决。 但是 ,将鼠标悬停在右侧(顶部和底部)时,会出现滚动条。 一个解决方案可以设置overflow: hidden的身体,所以预期的结果是所需的。 我想指出,这不是一个很好的解决方案,但我建议暂
Laravel检查是否存在记录(Laravel Checking If a Record Exists)
这取决于您是否要以后与用户合作,或仅检查是否存在。 如果要使用用户对象(如果存在): $user = User::where('email', '=', Input::get('email'))->first(); if ($user === null) { // user doesn't exist } 如果你只想检查 if (User::where('email', '=', Input::get('email'))->count() > 0) { // user found
设置base64图像的大小javascript - angularjs(set size of a base64 image javascript - angularjs)
$scope.getData= function () { var reader = new FileReader(); reader.onload = $('input[type=file]')[0].files; var img = new Image(); img.src =(reader.onload[0].result); img.onload = function() { if(this.width > 640
Copyright ©2023
peixunduo.com All
Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!
Laravel检查是否存在记录(Laravel Checking If a Record Exists)
设置base64图像的大小javascript - angularjs(set size of a base64 image javascript - angularjs)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!