<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Help defining Controller with Custom Dashboard and UserModule]]></title><description><![CDATA[<p dir="auto">I am attempting to add an Angular Controller to provide custom Dashboard control.  I am having issues with getting the Controller registered properly and am currently receiving the following error:</p>
<pre><code>Error: [ng:areq] Argument 'myDemoController' is not a function, got Object
https://errors.angularjs.org/1.8.3/ng/areq?p0=myDemoController&amp;p1=not%20a%20function%2C%20got%20Object
    at mangoUi~ngMango~ngMangoServices.js?v=50b41cf5dc12c51d5d91:336:837
    at ke (mangoUi~ngMango~ngMangoServices.js?v=50b41cf5dc12c51d5d91:336:11241)
    at je (mangoUi~ngMango~ngMangoServices.js?v=50b41cf5dc12c51d5d91:336:11358)
    at mangoUi~ngMango~ngMangoServices.js?v=50b41cf5dc12c51d5d91:336:60348
    at mangoUi~ngMango.js?v=e40cb7ee45260acf61ab:50:1715
    at mangoUi~ngMango~ngMangoServices.js?v=50b41cf5dc12c51d5d91:336:50964
    at ie (mangoUi~ngMango~ngMangoServices.js?v=50b41cf5dc12c51d5d91:336:51053)
    at mangoUi~ngMango~ngMangoServices.js?v=50b41cf5dc12c51d5d91:336:44909
    at ie (mangoUi~ngMango~ngMangoServices.js?v=50b41cf5dc12c51d5d91:336:52002)
    at mangoUi~ngMango~ngMangoServices.js?v=50b41cf5dc12c51d5d91:336:44909
</code></pre>
<p dir="auto">I have a userModule.js (yes, the myDashboardHelpers.js should be in a better folder):</p>
<pre><code>define((require) =&gt;
  angular
    .module("userModule", ["maUiApp"])
    .component("emsTrend", require("./components/trend/trend.js"))
    .directive('svgStyle', require('./directives/svgStyle.js'))
    .component("view", require("./components/view/view.js"))
    .controller("myDemoController", require("./directives/myDashboardHelpers.js"))
    );
</code></pre>
<p dir="auto">A myDashboardHelpers.js of:</p>
<pre><code>define(['angular', 'require'], function(angular, require) {
    'use strict';

    var myDashboardModule = angular.module('myDashboardModule', ['maUiApp']);

    myDashboardModule.controller('myDemoController', ['$scope', function($scope) {
        $scope.demoMode = 'STOPPED';
    
        $scope.stepDemo = function() {
            $scope.demoMode = 'STEP';
        };
    
        $scope.runDemo = function() {
            $scope.demoMode = 'RUN';
        };
    }]);

    return myDashboardModule;
});
</code></pre>
<p dir="auto">And a Dashboard Markup of:</p>
<pre><code>&lt;md-card flex="" layout="row" layout-wrap="" layout-align="space-between" ng-controller="myDemoController"&gt;
            &lt;md-card-content layout="column"&gt;
                &lt;ma-button id="9d571d5d-32ab-4949-9ddc-891f68f4b28b" raised="true" label="STEP" onclick="stepDemo()"&gt;&lt;/ma-button&gt;
                &lt;ma-button id="f3e1e931-62e2-4ddd-93d3-05a2787c0f6c" raised="true" label="RUN" onclick="runDemo()"&gt;&lt;/ma-button&gt;
            &lt;/md-card-content&gt;
            &lt;md-card-content layout="column"&gt;
                &lt;p&gt;MODE:{{demoMode}}&lt;/p&gt;
            &lt;/md-card-content&gt;
        &lt;/md-card&gt;
</code></pre>
<p dir="auto">I have been searching for the error in my ways on the forum and web with no luck.  I am running Mango Automation core Version 5.2.1.  Thanks in advance for any guidance on a solution / best practice ;-)</p>
]]></description><link>https://forum.mango-os.com/topic/5941/help-defining-controller-with-custom-dashboard-and-usermodule</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 22:39:45 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/5941.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 03 Feb 2025 23:48:17 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Help defining Controller with Custom Dashboard and UserModule on Wed, 12 Feb 2025 07:11:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a> Thanks!  Looks comprehensive.  I will work thru the example.  Greatly Appreciated!!!</p>
]]></description><link>https://forum.mango-os.com/post/28372</link><guid isPermaLink="true">https://forum.mango-os.com/post/28372</guid><dc:creator><![CDATA[mfitzgerald_wavetech]]></dc:creator><pubDate>Wed, 12 Feb 2025 07:11:36 GMT</pubDate></item><item><title><![CDATA[Reply to Help defining Controller with Custom Dashboard and UserModule on Tue, 11 Feb 2025 20:49:23 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mfitzgerald_wavetech" aria-label="Profile: mfitzgerald_wavetech">@<bdi>mfitzgerald_wavetech</bdi></a> sorry, face plate<br />
<a href="https://forum.mango-os.com/post/19718">https://forum.mango-os.com/post/19718</a></p>
]]></description><link>https://forum.mango-os.com/post/28371</link><guid isPermaLink="true">https://forum.mango-os.com/post/28371</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 11 Feb 2025 20:49:23 GMT</pubDate></item><item><title><![CDATA[Reply to Help defining Controller with Custom Dashboard and UserModule on Mon, 10 Feb 2025 12:44:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mattfox" aria-label="Profile: MattFox">@<bdi>MattFox</bdi></a> Thanks, but I am feeling dumb here.  I tried to find the 'faceplate' component example and could not find it on the forum....</p>
]]></description><link>https://forum.mango-os.com/post/28370</link><guid isPermaLink="true">https://forum.mango-os.com/post/28370</guid><dc:creator><![CDATA[mfitzgerald_wavetech]]></dc:creator><pubDate>Mon, 10 Feb 2025 12:44:46 GMT</pubDate></item><item><title><![CDATA[Reply to Help defining Controller with Custom Dashboard and UserModule on Tue, 04 Feb 2025 20:43:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/mfitzgerald_wavetech" aria-label="Profile: mfitzgerald_wavetech">@<bdi>mfitzgerald_wavetech</bdi></a></p>
<pre><code>var myDashboardModule = angular.module('myDashboardModule', ['maUiApp']);

    myDashboardModule.controller(
</code></pre>
<p dir="auto">Looks like you're making the same call twice to me<br />
Just wrap your controller in a function and return the function itself.</p>
<p dir="auto">Check out the component I wrote in the forum for 'faceplate'.  Despite it being a component, you'd do it the same way for a controller.</p>
<p dir="auto">Hope that gives you something to work with</p>
<p dir="auto">Fox</p>
]]></description><link>https://forum.mango-os.com/post/28368</link><guid isPermaLink="true">https://forum.mango-os.com/post/28368</guid><dc:creator><![CDATA[MattFox]]></dc:creator><pubDate>Tue, 04 Feb 2025 20:43:37 GMT</pubDate></item></channel></rss>