S
S
slip312015-01-16 11:19:32
css
slip31, 2015-01-16 11:19:32

How to change styles with Angular.js?

I'll try to explain the problem.
There are two pages - main (home) and internal (dashboard). The main one is full-width, and on the inside it is necessary to make a sticky sidebar.
An example is
on the dashboard page division is used

<div id="sidebar-wrapper">
    
    
        <ul class="sidebar-nav">
            <li class="sidebar-brand"><a href="#">Home</a></li>
            <li><a href="#">Another link</a></li>
            <li><a href="#">Next link</a></li>
            <li><a href="#">Last link</a></li>
        </ul>
    </div>
    <div id="page-content-wrapper">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <h1>Simple Sidebar</h1>
                        <p>This template has a responsive menu toggling system. The menu will appear collapsed on smaller screens, and will appear non-collapsed on larger screens. When toggled using the button below, the menu will appear/disappear. On small screens, the page content will be pushed off canvas.</p>
                        <p>Make sure to keep all page content within the <code>#page-content-wrapper</code>.</p>
                        <a href="#menu-toggle" class="btn btn-default" id="menu-toggle">Toggle Menu</a>
                    </div>
                </div>
            </div>
        </div>

But in order for the page-content-wrapper not to cover the entire area, you need to add to the styles
#wrapper {	
padding-left: 250px;
  }

How can I add this with angular? ngStyle in sidebar-nav?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
V
Vladislav, 2015-01-16
@slip31

We add a boolean variable to $rootScope , which we will change to true on the inner pages . For the necessary elements, we add ng-class, depending on the given value. Just he will add a class (for such things you do not need to use id).
Further we register in css style with an indent, we rejoice.

M
Mikhail Osher, 2015-01-16
@miraage

Add some class to the body that will mark the state, and dance from it.

body.withAside #wrapper {
    padding-left: 250px;
}

T
ThunderCat, 2017-07-10
@lemonlimelike

For those who are in the tank and DO NOT READ DOCKS
$res = mysqli_query() contains a RESOURCE object, a link to a piece of memory that contains the result of the query and a description of the state of the executed query. In particular, ["num_rows"]=> int(0) indicates that there are 0 rows in the sample, i.e. nichrome not found with such a request.
ps: to insert a get variable into the request - finally fire)

E
Eugene, 2017-07-10
@Flashter

did you try to output $res? not empty what? and there is definitely no mistakeINNER JOIN videos v ON

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question