Ng-click doesn't work (Solve but)


Hi guys,

Actually, I can solve with ui-sref attribute but I should do with ng-click function because I going to use $ in this function. My codes as short like this following;

var app = angular.module('myApp', ['ionic']);
app.config(function($stateProvider, $urlRouterProvider){
        url: '/main',
        templateUrl: 'main.html'
        url: '/yonetimPaneli',
        templateUrl: 'yonetimPaneli.html',
        url: '/sozlesmeSayfasi',
        templateUrl: 'sozlesmeSayfasi.html'

    $scope.sozlesmeSayfasiOpen = function(){

Ionic HTML is following;

<body ng-app="myApp">

    <script id="main.html" type="text/ng-template"></script>
    <script id="sozlesmeSayfasi.html" type="text/ng-template"></script>
    <script id="yonetimPaneli.html" type="text/ng-template">
       <button class="button button-block button-balanced" ng-click="sozlesmeSayfasiOpen()">
           Open it

That’s all. Do not worry, main.html and sozlesmeSayfasi.html are full. I was think my problem for not require.

Where is the my mistake ? I could not solve this. ui-sref is working in same codes. sozlesmeSayfasiOpen() function does not work, I was just add console.log in it, It does not show anything. And,

  • I was try $timeout function in $state.go is does not work.
  • I was just try console.log or sample alert function but does not work.

Thank you for interest.
Best regards…

Note: I am using ionic.bundle. So I am developping mobile application in Intel XDK over Ubuntu.

Update 1

I was solved is mistake. Does not work $stateProvider.state in controller attribute so it is not add auto controller. I was add controller with manually.

What do you think this problem ? Why do not auto add ?