Skip to content

Use a news selector

GeorgiMateev edited this page Sep 23, 2014 · 8 revisions

This tutorial demonstrates how to add a news selector in a designer view.

Prerequisites

Before you begin, please read about the basic principles of using a content selector.

Adding a news selector

  1. In your DesignerView.YourView.json file you have to add a scripts array. The content of the file should be similar to:

{ "priority": 1, "scripts": [ "Mvc/Scripts/Angular/angular-resource.min.js", "Services/services.js", "Services/news-item-service.js", "Selectors/selectors.js", "Selectors/list-selector.js", "Selectors/news-selector.js" ] } ``` 2. In your designerview-yourview.js place the following snippet right before the definition of your custom view controller:

```js

var designerModule = angular.module('designer'); angular.module('designer').requires.push('selectors'); ``` 3. In your DesignerView.YourView.cshtml place the following tag somewhere in the html:

```html
```

You can use the attributes selected-item and selected-item-id to access the selected value.

Clone this wiki locally