Custom View didn't work
-
Mango Core version: 3.6
Mango UI module version: 3.6When I followed the tutorial on making custom views, after refreshing the Hello World doesn't show up in the menu. How can I fix this?
-
Hi Ashley, welcome.
Do you mean the userModule or an actual dashboard page with the dashboard designer?
To give us a better idea of what you want to achieve, some code/markup text would be helpful. Be sure to use thecode tags
in the forum (a pair of 3 x ` together) to place the text between.Fox
-
Hello Fox,
I mean the userModule. -
Hi ashleydiep, welcome to the forum!
I had a look, and I think the issue is that on the help page the quote marks in the define section of the mainModule.js file are stylized single quotes instead of real, JavaScript comprehensible single quotes. Thanks for bringing this to our attention! I have fixed the help page. After I made this change in my mainModule.js file, the menu appeared as the help suggested it would.
define([ 'angular', 'require', './components/helloWorld.js' ], function(angular, require, helloWorld) { 'use strict'; var mainModule = angular.module('userModule', ['maUiApp']); mainModule.component('helloWorld', helloWorld); mainModule.config(['maUiMenuProvider', function(maUiMenuProvider) { maUiMenuProvider.registerMenuItems([ { name: 'ui.helloWorld', url: '/hello-world', menuText: 'Hello World', menuIcon: 'accessibility_new', abstract: true, menuHidden: false, weight: 996, }, { name: 'ui.helloWorld.home', url: '/home', template: '<hello-world></hello-world>', menuIcon: 'fa-home', menuText: 'Home', weight: 997, params: { noPadding: false, hideFooter: false, }, }, ]); }]); return mainModule; });
While i could have noticed this by the syntax highlighting in your post, I saved everything and loaded a page with my browser's developer tools open, found the mainModule.js on the sources tab, and saw that it had a syntax error on line 2.
-
Thanks Phil, man time differences suck, 8AM here!
-
At least it makes for better time coverage on people getting responses :D