Hi
Still struggling with this one so I tried to simplify my code for testing 
purposes. Below is my sample html page and below that is the controller 
syntax used in my controller folder.
I'm trying to get input from a box and pass the input to my ng-click to 
open FACEBOOK
e.g
<html ng-app="myApp" ng-controller="MyCtrl3">
<head>
    <script src="
https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js";></script
>
    <script src="js/controllers.js"></script>
      <meta charset=utf-8 />
    <title>JS Bin</title>
</head>
<body>
<div>
<input type = "text" ng-model="link">
    <p>{{link}}</p>
<button ng-click="foo">Facebook</button>  <!-- NOTE: THE FOO FUNCTION WORKS 
OK AND OPENS FACEBOOK - WHAT I WANT IS 
                                                                         TO 
ENTER foo IN MY INPUT BOX WHICH IN TURN GETS PASSED TO THE NG-CLICK ((LINK}}
    </div>
</body>
</html>

.... MY JVASCRIPT CONTROLLER SYNTAX...
angular.module('myApp', [])

.controller('MyCtrl3', function($scope, $window) {
    $scope.foo = function() {
        $window.open('//facebook.com');
    };
})

Regards





On Tuesday, January 21, 2014 2:00:19 PM UTC, Philip wrote:

> Hello - newbie
>  
> Using Angular syntax I am trying to get the onclick="dashboard1()" in my 
> code to use the "selected_report.name" feed.
>  
> My Code........
>  
> <!doctype html>
> <html ng-app>
> <head>
> <script src="
> https://ajax.googleapis.com/ajax/libs/angularjs/1.2.9/angular.min.js";>
> </script>
> <title>MY DASHBOARDS</title>
> </head>
> <div ng-controller="Reports">
>   <div>
>     <input type="search" ng-model="search">
>   </div>
> <select ng-model="selected_report"
>         ng-options="report.name for report in reports | filter:search">
>         <option value="">Choose a Report:</option>
>       </select>
> <hr>
> <div>
>   <label>Name:</label><input ng-model="selected_report.name">
>     <br>
>   <label>Name:</label><input ng-model="selected_report.parameter">
>   <input type="button" value="...." 
> onclick="dashboard1()">                            WHEN I CLICK ON THIS 
> BUTTON THEN FUNCTION DASHBOARD1() OPENS FINE - I WOULD LIKE TO USE THE 
>                                                                               
>                                           
> SELECTION FROM THE DROP DOWN MENU REPORTS FUNCTION I.E.  "
> SELECTED_REPORT.NAME"
>    </div>
>    </div>
>
> <script> 
> var Reports = function($scope){
>   $scope.reports = [
>   {name:"dashboard1",parameter:"none"},
>   {name:"dashboard12",parameter:"none"},
>   {name:"dashboard3",parameter:"none"}
>   ];
> };
> </script>
>  
> <script>
> function dashboard1()
> {
> window.location.assign("
> http://5:8000/views/HeadCount-/_?:embed=y&:display_count=no";)  
> }
>  
> <script>
> function dashboard2()
> {
> window.location.assign("
> http://15:8000/viewsLeavers/?:embed=y&:display_count=no";) 
> }
> </script>
>  
> <script>
> function dashboard3()
> {
> window.location.assign("
> http://15:8000/views/Dept?:embed=y&:display_count=no";) 
> }
>
> </script>
> </script>
> </body>
> </html>
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to