This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.directive('cycle', function($parse) { | |
return { | |
restrict: 'A', | |
priority: 400, | |
link: function (scope, element, attr) { | |
scope.$watch('isLoaded', function (newVal) { | |
if (!newVal) return; | |
var opts = $parse(attr.cycle); | |
$(element).cycle(opts()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@inherits Umbraco.Web.Mvc.UmbracoViewPage<App.Models.AngRenderModel> | |
@{ | |
Layout = Model.isApp ? "Blank.cshtml" : "Static.cshtml"; | |
} | |
@section Content { | |
@if (Model.isApp) | |
{ | |
<article umb-children="content.Id" cycle="{slides: '>div'}" style="clear: both"> | |
<div ng-repeat="slider in children"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<rewriter> | |
<!-- ignore all umbraco routes --> | |
<rewrite url="^(/umbraco/.*)" to="$1" processing="stop" /> | |
<!-- ignore all images, css, html fragments --> | |
<rewrite url="^(/.+(\.gif|\.png|\.jpg|\.ico|\.pdf|\.css|\.js|\.html|\.less|\.htm)(\?.+)?)$" to="$1" processing="stop" /> | |
<!-- if the header contains app we know it is a call to get a template. We need to let it pass --> | |
<if header="app" match="true"> | |
<rewrite url="(.*)" to="$1" processing="stop"/> | |
</if> | |
<!-- if google is indexing let's let it proceed and get all non angular views which is just the normal umbraco views with razor --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MvcApplication1 | |
{ | |
public class Global : UmbracoApplication | |
{ | |
protected override void OnApplicationStarting(object sender, EventArgs e) | |
{ | |
DefaultRenderMvcControllerResolver.Current.SetDefaultControllerType(typeof(DefaultController)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MvcApplication1.Controllers | |
{ | |
public class DefaultController : Umbraco.Web.Mvc.RenderMvcController | |
{ | |
// | |
// GET: /Default/ | |
public ActionResult Index(AngRenderModel model) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace App.Models | |
{ | |
public class AngRenderModel : Umbraco.Web.Models.RenderModel | |
{ | |
public bool isApp { get; set; } | |
public AngRenderModel(): base(UmbracoContext.Current.PublishedContentRequest.PublishedContent) | |
{ | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MvcApplication1.Models | |
{ | |
public class PropertyViewModel | |
{ | |
public object DataValue { get; set; } | |
public bool HasValue { get; set; } | |
public string PropertyTypeAlias { get; set; } | |
public object Value { get; set; } | |
public object XPathValue { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MvcApplication1.Controllers | |
{ | |
// mvc needs a class to serialize a post, this is for a url | |
public class UrlModel | |
{ | |
public string url { get; set; } | |
} | |
// id class for post | |
public class IdModel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Id": 1053, | |
"Name": "Site", | |
"Url": "/", | |
"Path": "-1,1053", | |
"ContentTypeAlias": "SiteMaster", | |
"Properties": { | |
"umbracoRedirect": { | |
"DataValue": "", | |
"HasValue": false, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('dw.services', []) | |
.value('serviceBase', "/umbraco/api/pagegenapi/") | |
.factory('serviceApi', ['serviceBase', function (serviceBase) { | |
var service = { | |
base: serviceBase, | |
getMedia: serviceBase + 'GetMedia', | |
getContent: serviceBase + 'getContent', | |
getPath: serviceBase + 'getPage', | |
getChildren: serviceBase + 'getChildren' |