Are You Judgmental?

We know what it feels like to be judged by another person. It feels crappy. So why do we do it to others? There’s a good reason, but we have to look into our animal nature. I was coaching a brilliant…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How To Develop Custom Views With AngularJS Components In Mango Automation

Custom views with AngularJS in Mango Automation

Mango Allows you to develop custom views as its frontend is based on AngularJS. So, We can code custom components to create almost anything that We can imagine.

Now, to do this, We have to follow the next steps:

File Stores

For this step we will need to go to Administration > File Stores in the menu. The File Stores allows us to upload any file that we want and Mango will store them for you.

By default, Mango create a default folder, but We will move to public folder by clicking File stores:

Then you can select public folder, and in this folder we will create a mainModule.js file with the next code:

This is a first structure for the module. I will talk about maUIMenuProvider later.

In this step you will need to go to Administration > UI settings, on miscellaneous settings section, on User module URL you select the mainModule.js file that We previously created.

NOTE: Don't forget to click save button after you select the module file.

The next thing that We will do is to create our first AngularJS component in Mango. Inside public folder We will create a components folder, and We will store our components inside of it. Let's call it helloWorld.js and the html template will be helloWorld.html.

In the helloWorld.js file We will add the next code:

and in the helloWorld.html file you can add whatever you want, for testing purposes, I will use the next code.

To see our view, first We need to load it in our module.

In the module We will add some new code:

The first item will create a new section on the menu. the name key has to be unique because the maUiMenuProvider will use it as an identifier, We will use name: 'ui.helloWorld' in this case.

The second item will create a route for the component inside of helloWorld section. As you can see the identifier is name: 'ui.helloWorld.home' because it is a child of the first item.

Finally, We will get this view:

And that's it, now you can use your own component in Mango!

Add a comment

Related posts:

Organic Farming and its Benefits

Organic farming has mushroomed drastically in importance and influence worldwide from its modest beginnings in the first half of the last century. Organic farming is production of food and livestock…

10 Lessons From 1 Million Screw Ups

Here we are in the world and everyday we get up to do things. Why does any of it matter? Why do people kiss — how did that become a thing? I guess I’ll just go with it, it’s not too bad actually. In…

cartas de amor.

Eu estou escrevendo uma carta para os meus pais. A verdade é que já tenho pensado sobre isso há muito tempo. Enquanto pensava lembrava do bolo de cartas que existe guardado em algum lugar da casa e…