# Custom $ionicLoading template issue

**URL:** <https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940>\
**Category:** ionic-v1\
**Created:** [June 21, 2014, 3:28pm UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940 "2014-06-21T15:28:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![shoustin](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shoustin](https://forum.ionicframework.com/u/shoustin)\
**Post date:** [June 21, 2014, 3:28pm UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/1 "2014-06-21T15:28:01Z")

</div>

Hello,

Ionic provides own Loading template (full screen) and I want to create custom one based on `$ionicLoading`.

So I thought to create my own directive that will take `$ionicLoading` as template. But found that it will be difficult to maintain.

Regards to DOCs:

> {string=} template The html content of the indicator.

So I created some method:

```
$ionicLoading.show({
            template: '<div>'+
'<div class="backdrop visible backdrop-loading active wm-proper-times" 
     style="height: 260px; margin-top: 245px; left: 8;"></div>'+
'<div class="loading visible active" style="margin-left: -53px; margin-top: 76px;background-color: rgba(240, 50, 50, 0.7);"><span>Custom Loading...</span></div>'+
'</div>',
            noBackdrop: true
        });  

```

But I got following result:

As you can see even if I added my custom loading, I still get square on top without text.  
**How can get rid of this empty square?**.

Here is [DEMO: http://codepen.io/anon/pen/FhCak](http://codepen.io/anon/pen/FhCak)

Thanks,

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [June 21, 2014, 4:11pm UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/2 "2014-06-21T16:11:29Z")

</div>

I don’t think it’s a bug, but rather the way you’re setting thing things up.

When you call the loader, it will create the markup that you included in your template, so what you were doing was along the lines of a loader inside a loader…woah

So if you wanted to custom the loader, you would just write some css for those divs. The template/templateUrl is more for customizing the content, not the actual loader.

See codepen below.

> **[Nested Flex](https://codepen.io/mhartington/pen/iDspb)**
>
> A barebones starter template for Ionic development Forked from \[Mike Hartington\](/mhartington)'s Pen \[Nested Flex\](/mhartington/pen/aGovC/). Forked f...

---

<div class="post-metadata">

**Author:** ![shoustin](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shoustin](https://forum.ionicframework.com/u/shoustin)\
**Post date:** [June 21, 2014, 5:08pm UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/3 "2014-06-21T17:08:19Z")

</div>

Thank you very much. Great work!

---

<div class="post-metadata">

**Author:** ![shoustin](https://avatars.discourse-cdn.com/v4/letter/s/4af34b/32.png) [@shoustin](https://forum.ionicframework.com/u/shoustin)\
**Post date:** [June 21, 2014, 6:36pm UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/4 "2014-06-21T18:36:24Z")

</div>

As a side note, I suggest to add to document `templateUrl` support.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [June 21, 2014, 7:26pm UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/5 "2014-06-21T19:26:49Z")

</div>

Ideally, IMO, I would have all components (action sheet, popups, loading, etc.) be set up similar to modals. Point to a template html file, have a div with a class of popup, action-sheet, loading, and then throw your content in there.

---

<div class="post-metadata">

**Author:** ![vaibhavn1](https://avatars.discourse-cdn.com/v4/letter/v/c4cdca/32.png) [@vaibhavn1](https://forum.ionicframework.com/u/vaibhavn1)\
**Post date:** [January 22, 2015, 2:46pm UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/6 "2015-01-22T14:46:02Z")

</div>

Hi mhartingon,

How can we use loading.html in a normal application with many templates file in it. Because when I posted loading.html file in my template folder , the application was giving file not found error. So where should we keep loading,html file ?

Regards

Vaibhav

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [January 22, 2015, 3:05pm UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/7 "2015-01-22T15:05:00Z")

</div>

Hmm is the path relative to the index.html?

> **[Nested Flex](https://codepen.io/mhartington/pen/vEZBwO)**
>
> A barebones starter template for Ionic development Forked from \[Mike Hartington\](/mhartington)'s Pen \[Nested Flex\](/mhartington/pen/aGovC/). Forked f...

I tried a template for my loader and it worked fine for me.

---

<div class="post-metadata">

**Author:** ![yurinondual](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/yurinondual/32/92490_2.png) [@yurinondual](https://forum.ionicframework.com/u/yurinondual)\
**Post date:** [March 4, 2015, 10:01am UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/8 "2015-03-04T10:01:21Z")

</div>

Sorry for hijacking this thread, but is there a way to set ionicLoading template globally rather than for each instance?

---

<div class="post-metadata">

**Author:** ![slim](https://avatars.discourse-cdn.com/v4/letter/s/b5e925/32.png) [@slim](https://forum.ionicframework.com/u/slim)\
**Post date:** [March 21, 2015, 10:45am UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/9 "2015-03-21T10:45:39Z")

</div>

you could create a service or directive

---

<div class="post-metadata">

**Author:** ![abiii666](https://avatars.discourse-cdn.com/v4/letter/a/8e8cbc/32.png) [@abiii666](https://forum.ionicframework.com/u/abiii666)\
**Post date:** [August 11, 2015, 6:06am UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/10 "2015-08-11T06:06:08Z")

</div>

How can i make the bottom message i.e “Custom Loading” as dynamic one ?..Is it possible to change the texts ?

---

<div class="post-metadata">

**Author:** ![Atula](https://avatars.discourse-cdn.com/v4/letter/a/c89c15/32.png) [@Atula](https://forum.ionicframework.com/u/Atula)\
**Post date:** [May 3, 2016, 11:00am UTC](https://forum.ionicframework.com/t/custom-ionicloading-template-issue/5940/11 "2016-05-03T11:00:53Z")

</div>

Can’t we change the color of spinner inside $ionicLoading?
