-
Notifications
You must be signed in to change notification settings - Fork 68
Use a news selector
This tutorial demonstrates how to add a news selector in a designer view.
Before you begin, please read about the basic principles of using a content selector.
-
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.
Home | What's new | FAQ