[SOLVED] Habpanel: widget with js which should read item value

I have a Habpanel widget where I would like to display an iframe with a dynamic “src” parameter.
my widget definition:

<div oc-lazy-load="['/static/time-line-picker/js/habpanel.js']">
  <div ng-controller="ngopen">
    		<iframe ng-open ="getdetails()" width="103%" height="475px" frameBorder="0" align="middle" src={{src}}>      


(function() {
  'use strict';
  .module('app', [])
  .controller('ngopen', ['$scope', function($scope) {
        $scope.getdetails = function (source) {
        $scope.src = "/static/time-line-picker/index.html?ip=,2,3,4,5,6,7&lang=de&event=no&dark=yes&zoom=no&colorset=17&states=17,18,19,20,21,22";


I would like to read the values for the parameters “colorset” and “states” in the “$scope.src =” string from an item (or the whole “src=” string from an item).
I’m new in js so I hope someone can point me to the right direction.

The built-in Frame widget in HABPanel already has an option to use the state of a String item as the URL, isn’t it already what you want?

thx for the hint. but i need to display 3 different url‘s depending on another item state. the part of the widget code is inside a ng-if.

Edit: you are right, the URL can be built within a rule also depending on other rule states. Thanks a lot.