Angular JS : $ is undefined


I am new to Angular js. I have tried the following code:

    <title>angular js</title>
    <script src="js/lib/jquery.min.js"></script>
    <script src="js/lib/angular.min.js"></script>
<body ng-app="MyApp" ng-controller="MyController">
    <input ng-model="data.selected">

    var app = angular.module('MyApp',[]);
        $ = "Initial Text";


I tried this code to show the initial text in the H1 tag. But I got the error $ is undefined What is wrong here? How can I solve this?

Problem courtesy of: Sajith


This isn't an AngularJS-specific issue, but a general JavaScript error.

in the controller you're accessing the field "selected" of something undefined. try

$ = {}; 
$"initial text"


$ = {selected : "initial text"};

Solution courtesy of: Eduard Gamonal


try $ = {"selected":"Initial Text"};

Discussion courtesy of: Sumeshk

This recipe can be found in it's original form on Stack Over Flow.