0

Hi can you please tell me how to add background image in angular which should display on whole application on whole page.?

secondly how to add different background image at different view on whole page ..?

here is my plunker http://plnkr.co/edit/BTl3NwEd66IMddKtPDMR?p=preview

 <div bg>
<button ng-click="goTONextpage()" >Go to next Page</button> </div>
1
  • any update of this Question Commented Aug 13, 2014 at 8:18

1 Answer 1

0

You can use ng-style in body tag

<body ng-style="{'background-image':'url(yourImg.png)'}">
  ...
</body>

Setting different background for different view:

set variable named image_path with different values of different views

<body ng-style="image_path != '' && {'background-image':'url('+image_path+')'}" >
  ...
<body>
Sign up to request clarification or add additional context in comments.

3 Comments

can you make plunker ..!! it will add in all view ? can i add class which is define in css
check this plunker ..plnkr.co/edit/KfY9Xo2br3AD6UOzoZlE?p=preview..It doesn't work for me
can you please give plunker ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.