angular.module('umbraco.resources').factory('categoryResource', function ($q, $http) { return { getAll: function () { return $http.get("KSJ/Ucommerce/GetAllCategories"); } }; } );
App_Plugins/CategoryEditor/CategoryEditor.html
App_Plugins/CategoryEditor/package.manifest
{
//you can define multiple editors
propertyEditors: [
{
/*this must be a unique alias*/
alias: "KSJ.CategoryEditor",
/*the name*/
name: "Category Editor",
/*the html file we will load for the editor*/
editor: {
view: "~/App_Plugins/CategoryEditor/CategoryEditor.html"
}
}
]
,
//array of files we want to inject into the application on app_start
javascript: [
'~/App_Plugins/CategoryEditor/CategoryEditor.controller.js'
]
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Http;
using Umbraco.Web.Editors;
namespace ERetro.dk.PropertyEdiors.Controllers
{
[Umbraco.Web.Mvc.PluginController("KSJ")]
public class UcommerceController : UmbracoAuthorizedJsonController
{
public string[] GetAllCategories()
{
var lst = new List();
lst.AddRange(UCommerce.EntitiesV2.Category.All().Select(c => c.Name));
return lst.ToArray();
}
}
}
Property editor error EditorProvider
Hi I'm trying to create a ucommerce category property editor. But I keep getting an error:
Afaik this is an Angular error, but as I'm new to Angular i can't figure out why I'm getting it! Anyone?
Regards Kenneth
Code:
App_Plugins/CategoryEditor/CategoryEditor.Controller.js
App_Plugins/CategoryEditor/Category.resource.js
App_Plugins/CategoryEditor/CategoryEditor.html
App_Plugins/CategoryEditor/package.manifest
{ //you can define multiple editors propertyEditors: [ { /*this must be a unique alias*/ alias: "KSJ.CategoryEditor", /*the name*/ name: "Category Editor", /*the html file we will load for the editor*/ editor: { view: "~/App_Plugins/CategoryEditor/CategoryEditor.html" } } ] , //array of files we want to inject into the application on app_start javascript: [ '~/App_Plugins/CategoryEditor/CategoryEditor.controller.js' ] }PropertyEditors/Controllers/UCommerceController.cs
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Http; using Umbraco.Web.Editors; namespace ERetro.dk.PropertyEdiors.Controllers { [Umbraco.Web.Mvc.PluginController("KSJ")] public class UcommerceController : UmbracoAuthorizedJsonController { public string[] GetAllCategories() { var lst = new List(); lst.AddRange(UCommerce.EntitiesV2.Category.All().Select(c => c.Name)); return lst.ToArray(); } } }I Figured out it was because the resource file was not included in the manifest
but now i'm getting a new error
Error: Argument 'KSJ.CategoryController' is not a function, got undefined at Error (native) at cb (http://local.ucom/umbraco/lib/angular/1.1.5/angular.min.js:17:114) at xa (http://local.ucom/umbraco/lib/angular/1.1.5/angular.min.js:17:187) at http://local.ucom/umbraco/lib/angular/1.1.5/angular.min.js:53:310 at http://local.ucom/umbraco/lib/angular/1.1.5/angular.min.js:44:274 at n (http://local.ucom/umbraco/lib/angular/1.1.5/angular.min.js:7:74) at k (http://local.ucom/umbraco/lib/angular/1.1.5/angular.min.js:44:139)
Got the same error:
Error: Argument 'UCommerceDomination.UCommerceDominationController' is not a function, got undefined
You found a solution?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.