Tips for enhancing the appearance of a dir-paginate

As a newcomer to AngularJS, I'm interested in learning how to apply styling to a pagination box. Below is the code for displaying a rectangular box view: `

<dir-pagination-controls 
            max- size = "10"
            direction-links = "true"
            boundary-links = "true"
            class="ml-pagination-numbers" > 

I would like to achieve the following style:

Inspected Element

    <ul class="pagination ng-scope" ng-if="1 < pages.length || !autoHide">
  <!-- ngIf: boundaryLinks -->
  <li ng-if="boundaryLinks" ng-class="{ disabled : pagination.current == 1 }" class="ng-scope disabled"><a href="" ng-click="setCurrent(1)">«</a></li>
  <!-- end ngIf: boundaryLinks -->
  <!-- ngIf: directionLinks -->
  <li ng-if="directionLinks" ng-class="{ disabled : pagination.current == 1 }" class="ng-scope disabled"><a href="" ng-click="setCurrent(pagination.current - 1)">‹</a></li>
  <!-- end ngIf: directionLinks -->
  <!-- ngRepeat: pageNumber in pages track by tracker(pageNumber, $index) -->
  <li ng-repeat="pageNumber in pages track by tracker(pageNumber, $index)" ng-class="{ active : pagination.current == pageNumber, disabled : pageNumber == '...' || ( ! autoHide &amp;&amp; pages.length === 1 ) }" class="ng-scope active"><a href="" ng-click="setCurrent(pageNumber)" class="ng-binding">1</a></li>
  <!-- end ngRepeat: pageNumber in pages track by tracker(pageNumber, $index) -->
  <li ng-repeat="pageNumber in pages track by tracker(pageNumber, $index)" ng-class="{ active : pagination.current == pageNumber, disabled : pageNumber == '...' || ( ! autoHide &amp;&amp; pages.length === 1 ) }" class="ng-scope"><a href="" ng-click="setCurrent(pageNumber)" class="ng-binding">2</a></li>
  <!-- end ngRepeat: pageNumber in pages track by tracker(pageNumber, $index) -->
  <!-- ngIf: directionLinks -->
  <li ng-if="directionLinks" ng-class="{ disabled : pagination.current == pagination.last }" class="ng-scope"><a href="" ng-click="setCurrent(pagination.current + 1)">›</a></li>
  <!-- end ngIf: directionLinks -->
  <!-- ngIf: boundaryLinks -->
  <li ng-if="boundaryLinks" ng-class="{ disabled : pagination.current == pagination.last }" class="ng-scope"><a href="" ng-click="setCurrent(pagination.last)">»</a></li>
  <!-- end ngIf: boundaryLinks -->
</ul>

How can I implement the above style for the Angular pagination? https://i.sstatic.net/jEq3R.png

Answer №1

After integrating a template into my dir-pagination-tools and customizing it to fit the style of my company, I have successfully resolved the issue!

<link rel="stylesheet" href="../resources/css/pagination.css"><div class="ml-pagination-numbers" ng-if="pageNumber>1"ng-disabled="pagination.current == 1" ng-click="setCurrent(1)">1</div><div class="ml-pagination-numbers pg-back" ng-if="pageNumber<7"ng-disabled="pagination.current == 1"ng-click="setCurrent(pagination.current - 1)">&lsaquo;...</div>
<div class="ml-pagination-numbers"ng-repeat="pageNumber in pages track by tracker(pageNumber, $index)"ng-click="setCurrent(pageNumber)"ng-class="{ 'ml-current-page' : pagination.current == pageNumber}">{{pageNumber}}</div>
<div class="ml-pagination-numbers pg-next"ng-if="pageNumber>6" ng-disabled=" pagination.current == pagination.last" ng-click="setCurrent(pagination.current + 1)">...&rsaquo;</div>

Best regards

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Hover Effect with CSS Selector - JavaScript or jQuery Implementation

I have a similar code snippet: <article class="leading-0"> <h2> <a href="link">link title</a> </h2> <ul class="actions"> <li class="print-icon"> <a ...><img...>& ...

Issue with AngularJS controller not functioning properly in the application

Hey there, hope everyone is doing well! I recently started learning AngularJS and things were going smoothly. I've been creating controllers and using them in my webpages with no issues. However, I've hit a roadblock when trying to create a contr ...

Silver button seems blue on iPhone

After creating this html code for a blue login button: <div class="p12"> <input type="submit" value="Log In" class="button loginButton"> </div> I added the following CSS style to it: .loginButton { background-color:#627aad; border:1px ...

What is the process for clearing the input value of a View from another View?

My situation seems simple and straightforward, yet I am struggling to achieve the desired output. In this scenario, I have two HTML pages named Index.htm and Main.htm, as well as a script page named mscript.js. Index.htm contains a button (Clear), and Mai ...

Creating a dynamic dropdown menu using jQuery animation

I am looking to add animation to my top navigation bar. Currently, the dropdown menus just appear suddenly when hovering over the links in the top nav. Development site: I have attempted the following: <script> jQuery(document).ready(function() { ...

Step-by-step guide for integrating a Twig file in Symfony using Angular's ng-include feature

Seeking guidance in Angular, as a newcomer to the platform. I attempted to load a template within an ng-repeat loop like so, but encountered an error. I received the following error message: "Cross origin requests are only supported for protocol schemes ...

How to correctly position a modal in a React application using CSS

Currently, I am working on integrating the react-modal NPM library into a React Typescript project. The issue I am facing is that the modal occupies the entire width of the screen by default, with padding included. My goal is to have it display as a small ...

Is there a way to adjust the dimensions of the "col-sm-9" div class in terms of width and height?

Struggling to adjust the size of my , but for some reason, the height command in CSS isn't taking effect. How can I set a custom size for it? This is important for my image slider, as the col-sm-10 is just too large on my website. Looking forward to y ...

How can I utilize Bootstrap ordering to rearrange the position of an element into a different column at a specific breakpoint?

I'm attempting to achieve a specific layout using Bootstrap order classes: https://i.sstatic.net/NKhg9.png Currently, I have something similar to this setup (assuming all elements are of equal height): <div class="row"> <div class="col- ...

Weird Android CSS problem: mysterious white overlay appearing in all browsers, both zoomable and touch-sensitive

After testing my website in various browsers, I discovered that while it looks fine on most platforms, there is a persistent issue on Android devices. The problem occurs when the user scrolls down around 30% of the page - a white overlay appears and exten ...

ngTableParams Using $http.get for pagination

Currently tackling a challenge on my AngularJS project: When dealing with locally stored or hard-coded data, the pagination functions smoothly. However, when working with remotely stored data, the pagination malfunctions. Despite extensive research, I ha ...

Challenges with installing NPM on Mac OS Mavericks

Currently, I'm delving into the world of AngularJS, NodeJS, and Ruby on Rails. However, I've hit a roadblock while attempting to install npm packages such as yeoman and grunt. The Terminal throws an error message at me, which I've included b ...

AngularJS extension known as 'ngclipboard'

I've been attempting to utilize a plugin called ngclipboard in Angular, but something seems amiss as it's not functioning as expected. There are no error messages, however, the text from the input box is not being copied to the clipboard. To see ...

The content momentarily flashes on the page during loading even though it is not visible, and unfortunately, the ng-cloak directive does not seem to function properly in Firefox

<div ng-show="IsExists" ng-cloak> <span>The value is present</span> </div> After that, I included the following lines in my app.css file However, the initial flickering of the ng-show block persists [ng\:cloak], [ng-cloak], ...

What is preventing me from binding ng-click to my element?

I've encountered an issue where the ng-click event is not activating on my element. Despite using the in-line controller script as shown below, I am unable to trigger my alert. Are there any integration issues that I should be mindful of? What could p ...

When incorporating Transify, don't forget to apply the border-radius property to enhance

I found a solution to make a div semi-transparent using Transify, but I also want to add rounded edges. The issue I'm facing is that the rounded edges only appear after the page has fully loaded when using Transify. Here is the CSS code: .grid { ...

What is the best way to customize the small square area found between the vertical and horizontal scrollbars?

Please take a look at the images provided below: https://i.stack.imgur.com/QVHfh.jpghttps://i.stack.imgur.com/cubd8.jpg Whenever both vertical and horizontal scrollbars intersect, it results in a square space. This phenomenon occurs not just within the b ...

Showing the updated list of items following deletion in AngularJS: A step-by-step guide

I am currently in the process of learning AngularJS and how to integrate it with ASP.NET Web API. My main challenge at the moment revolves around updating the list of products displayed on the page after a manager successfully deletes a product. The goal i ...

Show or hide specific elements based on parameters using ng-show in Angular

One challenge I am facing is how to manage a menu with multiple buttons that open submenus without using a massive switch statement in my code. Instead, I want to try something different: In the HTML file, I call the function toggleVis and pass the nam ...

Having trouble accurately referencing the domain across various servers

I have set up two servers for production - one for php files and the other for static (css, js) files. Within my config.php file: $path ="https://mystaticdomain.com/"; To simplify access to paths, I created a variable to store the path for css and js fi ...