There is a button that leads to the portfolio page, after the click, I want to redirect the user to the element with a specific id.
Here is the button (on the main.html page)
<a ng-href="#/portfolio#brif"> <div class="ibtn" > <svg> <rect x="0" y="0" fill="none" width="166" height="45" /> </svg> Заполнить бриф </div> </a> Here is the item to which I refer (page porfolio.html)
<section class="wrapp_content brif_na dark_blue" id="brif"> <ng-include src="'template/form.html'"></ng-include> </section> Here is an application on which you can see what I mean (i.e. when loading, if you click on "fill in the brief" - it will take "our services" to the top of the page, returning to the main page and repeating the action, refer to the ID, apparently ng-include does not have time to boot for the first time.
But if you try to insert such code into controller.js
remindApp.run(function($rootScope, $location, $anchorScroll, $routeParams) { $rootScope.$on('$routeChangeSuccess', function(newRoute, oldRoute) { $location.hash($routeParams.scrollTo); $anchorScroll(); }); }); And the link itself is replaced by:
<a ng-href="#portfolio?scrollTo=brif" > That occurs strange behavior, the transition is carried out and even strives to the right place, but does not reach the end - here are the screens:
AT FIRST TRANSIT
SECOND TRANSITION
P / S: Of course, you can not refer to ng-include and write something else, but I want to deal with the behavior, I do not understand why there is a difference between the first and second methods and how to say ng-href to work after ng-include. Thanks in advance for your patience


new fileitem - Grundy